System, method and article for controlling the dispensing of insulin

ABSTRACT

An integrated circuit includes circuitry to control a process. The process includes adjusting fuzzy-logic control parameters based on received and retrieved blood glucose-related data, predicting blood glucose levels based on the received blood-glucose-related data, and generating control signals to control dispensing of insulin based on the received blood glucose-related data and the fuzzy-logic control parameters. The process may include predicting blood glucose levels based on the retrieved blood glucose-related data. The process may include transitioning between a post-meal correction protocol and a fasting protocol. The process may include transitioning from a post-meal correction protocol to a fasting protocol when a fasting criteria is satisfied.

BACKGROUND OF THE INVENTION Field of the Invention

This disclosure generally relates to a system, method and article forpredicting and controlling blood glucose levels, and more particularlyto a system, method and article for controlling the dispensing ofinsulin.

Description of the Related Art

Carefully controlling blood sugar is a key to maintaining good health.Insulin, a hormone produced by the pancreas, helps maintain normal bloodsugar levels. Diabetes mellitus, usually called diabetes, is a diseasein which an individual's pancreas does not make enough insulin or theindividual's body cannot use normal amounts of insulin properly.Hypoglycemia, blood glucose that is too low, and hyperglycemia, bloodsugar that is too high, can result from poor control of blood glucoselevels.

In otherwise healthy diabetics, uncontrolled or high blood sugar levelscan lead to health complications such as blindness, heart diseases, andkidney disease. Recent research of patients in hospital Intensive CareUnits has shown that trauma resulting from severe illness and surgerycan also induce elevated blood sugar, which aggravates infection andextends the recovery process.

BRIEF SUMMARY OF THE INVENTION

This disclosure is directed to a system, method and device forautomatically predicting and controlling blood glucose levels. Thisdisclosure is further directed to a system, method and device forautomatically controlling the dispensing of insulin. Yet further, thisdisclosure is directed to a system, method and device for automaticallyadjusting a control system to respond to insulin sensitivity in realtime.

In one embodiment, a blood glucose system comprises means for sensingindications of blood glucose levels and means for predicting bloodglucose levels based on sensed indications of blood glucose levelscommunicatively coupled to the means for sensing indications of bloodglucose levels. In one embodiment, the control system further comprisesmeans for dispensing insulin wherein the means for predicting isconfigured to control the means for dispensing insulin based on thesensed indications. In one embodiment, the means for sensing indicationsof blood glucose levels comprises a plurality of blood glucose sensors.In one embodiment, the blood glucose control system further comprisesmeans for receiving user input. In one embodiment, the means forreceiving user input comprises a keypad. In one embodiment, the meansfor receiving user input comprises a computer readable memory medium. Inone embodiment, the blood glucose control system further comprises meansfor providing user output.

In one embodiment, the means for predicting is further configured todetect a dangerous condition. In one embodiment, the dangerous conditionis an active insulin level above a threshold active insulin level andthe means for predicting is further configured to suspend the dispensingof insulin when the dangerous condition is detected. In one embodiment,the dangerous condition is a predicted active insulin level above athreshold active insulin level and the means for predicting is furtherconfigured to suspend the dispensing of insulin when the dangerouscondition is detected. In one embodiment, the dangerous condition is ablood glucose level above a high-threshold blood glucose level. In oneembodiment, the dangerous condition is a predicted blood glucose levelabove a high-threshold blood glucose level. In one embodiment, thedangerous condition is a blood glucose level below a low-threshold bloodglucose level. In one embodiment, the dangerous condition is a predictedblood glucose level below a low-threshold blood glucose level.

In one embodiment, the means for predicting is configured to controlpostprandial and fasting blood sugar in an insulin dependent diabeticand the sensed indications are compared to blood sugar targets which area function of a level of compliance with an intensive insulin therapyprotocol. In one embodiment, the means for predicting is configured totransition into a semi-automatic mode. In one embodiment, the means forpredicting is configured to transition into a fully automatic mode. Inone embodiment, the means for predicting is configured to detect highblood glucose levels. In one embodiment, the means for predicting isconfigured to predict high blood glucose levels. In one embodiment, themeans for predicting is configured to detect low blood glucose levels.In one embodiment, the means for predicting is configured to predict lowblood glucose levels. In one embodiment, the means for predicting isconfigured to selectively transition between a post-meal correction modeand a fasting mode based on the sensed indications of blood glucoselevels. In one embodiment, the means for predicting is configured toselectively transition from the post-meal correction mode to the fastingmode when a fasting criteria is satisfied. In one embodiment, the meansfor predicting is configured to selectively transition from the fastingmode to the post-meal correction mode when a prandial event is detected.In one embodiment, the means for predicting is configured to selectivelytransition from the fasting mode to a user-input mode when a prandialevent is detected.

In one embodiment, the means for predicting is configured to maintain adata structure based on the sensed indications. In one embodiment, themeans for predicting is configured to predict blood glucose levels basedon the maintained data structure. In one embodiment, the means forpredicting is configured to predict blood glucose levels based on thesensed blood glucose levels and previously predicted blood glucoselevels. In one embodiment, the means for predicting is configured topredict a subsequent blood glucose level by treating a previouslypredicted blood glucose level as an actual blood glucose level.

In one embodiment, the means for predicting is configured to maintain afuzzy-logic rules matrix based on the sensed indications. In oneembodiment, the means for predicting is configured to maintain thefuzzy-logic rules matrix based on the sensed indications and previouslypredicted blood glucose levels. In one embodiment, the means forpredicting is configured to predict blood glucose levels based on themaintained fuzzy-logic rules matrix.

In one embodiment, a control system comprises a blood glucose sensorsystem configured to sense data indicative of blood glucose levels, auser input device configured to receive user data, an insulin dispenserconfigured to selectively dispense insulin in response to a controlsignal, and a controller configured to selectively generate the controlsignal and communicatively coupled to the sensor system, the dispenserand the user input device, wherein the controller is configured toautomatically transition between states of operation comprising acompliant state of operation and an insulin-dose-control state ofoperation. In one embodiment, the states of operation further comprise asemi-compliant state of operation and the controller is configured toautomatically transition between the compliant state of operation, thesemi-compliant state of operation and the insulin-dose-control state ofoperation.

In one embodiment, the control system further comprises a memory coupledto the controller and configured to store previously sensed data relatedto blood glucose levels, wherein the controller is configured toselectively generate the control signal based on currently sensed dataand the stored previously sensed data. In one embodiment, the controlsystem further comprises a blood glucose level predictor.

In one embodiment, the blood glucose sensor system comprises a pluralityof blood glucose sensors. In one embodiment, the blood glucose sensorsystem is configured to sense data related to blood glucose levels atfifteen-minute intervals, or other periodic or non-periodic intervals.

In one embodiment, the controller is configured to transition to theinsulin-dose-control state of operation when a fasting criteria issatisfied. In one embodiment, the controller is configured to determinewhether the fasting criteria is satisfied by comparing an indicator of acurrent blood glucose level to a fasting blood glucose level range. Inone embodiment, the control signal comprises and indication of an amountof insulin to be dispensed by the insulin dispenser. In one embodiment,the control signal comprises an indication of a schedule for insulin tobe dispensed by the insulin dispenser. In one embodiment, the controlleris configured to transition out of the insulin-dose-control state inresponse to an indication of a prandial event. In one embodiment, thecontroller is configured to transition from the insulin dose controlstate to the compliant state when the indication of a prandial eventincludes an indication of a blood sugar content. In one embodiment, thecontroller is further configured to selectively transition to auser-input mode of operation.

In one embodiment, the controller is configured to transition to theuser-input mode of operation in response to an indication of a dangerouscondition. In one embodiment, the indication of a dangerous condition isan indication that a blood glucose level exceeds a threshold maximumlevel. In one embodiment, the indication of a dangerous condition is anindication that a blood glucose level is below a threshold minimumlevel. In one embodiment, the indication of a dangerous condition is anindication that an active insulin level exceeds a threshold activeinsulin level. In one embodiment, the controller employs fuzzy logic togenerate the control signal in the fasting mode of operation. In oneembodiment, the controller employs a look-up table to generate thecontrol signal in the fasting mode of operation. In one embodiment, thecontrol signal is generated by comparing sensed blood glucose levels totarget levels.

In one embodiment, a method of automatically controlling dispensing ofinsulin comprises automatically analyzing data related to blood glucoselevels, when the analysis of the data is consistent with a prandialevent, automatically generating control signals to cause insulin to bedispensed according to a post-meal correction protocol; and when theanalysis of the data is consistent with fasting, automaticallygenerating control signals to cause insulin to be dispensed according toa fasting protocol. In one embodiment, the post-meal correction protocolcomprises dispensing a bolus insulin dose. In one embodiment, thepost-meal correction protocol comprises adjusting a basal insulin dose.In one embodiment, the method of automatically controlling dispensing ofinsulin further comprises measuring indicators of blood glucose levels,wherein analyzing the data comprises analyzing the measured indicatorsof blood glucose levels. In one embodiment, the method of automaticallycontrolling dispensing of insulin further comprises receivinguser-input-data, wherein analyzing the data comprises analyzing thereceived user-input-data.

In one embodiment, the method of automatically controlling dispensing ofinsulin further comprises automatically detecting a dangerous condition;and when the dangerous condition is detected, selectively generatingcontrol signals to terminate automatic control. In one embodiment,automatically detecting a dangerous condition comprises determiningwhether a blood glucose level is above a threshold blood glucose level.In one embodiment, automatically detecting a dangerous conditioncomprises determining whether a rate of change of a blood glucose levelis above a threshold rate of change. In one embodiment, automaticallydetecting a dangerous condition comprises determining whether an activeinsulin level exceeds a threshold active insulin level and, when thedangerous condition is detected, selectively generating control signalsto cause the suspension of dispensing of insulin.

In one embodiment, the method of automatically controlling dispensing ofinsulin further comprises, when the dangerous condition is detected,generating control signals to alert a user to the dangerous condition.In one embodiment, the method of automatically controlling dispensing ofinsulin further comprises, when the dangerous condition is detected,generating control signals to request user input. In one embodiment, themethod of automatically controlling dispensing of insulin furthercomprises employing fuzzy logic to generate the control signals to causeinsulin to be dispensed when insulin is dispensed under the fastingprotocol. In one embodiment, the fuzzy logic inputs comprise anindicator of blood glucose level, an indicator of a rate of change ofthe blood glucose level, and an indicator of an acceleration of theblood glucose level. In one embodiment, the method of automaticallycontrolling dispensing of insulin further comprises maintaining a datastructure. In one embodiment, the method of automatically controllingdispensing of insulin further comprises maintaining a fuzzy-logicmatrix. In one embodiment, maintaining a fuzzy logic matrix comprisesmodifying values in the fuzzy-logic matrix based on the analysis of thedata related to blood glucose levels. In one embodiment, the analysis ofthe data comprises predicting future blood glucose levels. In oneembodiment, the method of automatically controlling dispensing ofinsulin further comprises storing instructions in a computer readablememory medium to cause a controller to control the dispensing of insulinby performing the method.

In one embodiment, a computer-readable memory medium containsinstructions for causing a controller to control the dispensing ofinsulin by analyzing data related to blood glucose levels, when theanalysis of the data is consistent with a prandial event, generatingcontrol signals to cause insulin to be dispensed according to apost-meal correction protocol, and when the analysis of the data isconsistent with fasting, generating control signals to cause insulin tobe dispensed according to a fasting protocol. In one embodiment, theinstructions further cause the controller to control the dispensing ofinsulin by analyzing indicators of a dangerous condition, and when theanalysis of the indicators of a dangerous condition is consistent withthe dangerous condition, generating control signals to suspenddispensing of insulin. In one embodiment, the post-meal correctionprotocol comprises dispensing a bolus insulin dose. In one embodiment,the post-meal correction protocol comprises adjusting a basal insulindose. In one embodiment, the instructions further cause the controllerto control the dispensing of insulin by measuring indicators of bloodglucose levels, wherein the analyzed data comprises the measuredindicators of blood glucose levels. In one embodiment, the instructionsfurther cause the controller to control the dispensing of insulin byreceiving user-input-data, wherein the analyzed data comprises thereceived user-input-data. In one embodiment, the instructions furthercause the controller to control the dispensing of insulin by predictingfuture blood glucose levels, wherein the analyzed data comprises thepredicted future blood glucose levels. In one embodiment, theinstructions further cause the controller to control the dispensing ofinsulin by determining an active insulin level, wherein the analyzeddata comprises the determined active insulin level. In one embodiment,the instructions further cause the controller to control the dispensingof insulin by maintaining a fuzzy-logic matrix, wherein the analyzeddata comprises values in the maintained fuzzy-logic matrix.

In one embodiment, a system for predicting blood glucose levelscomprises a data input subsystem configured to receive bloodglucose-related data, a blood glucose level predictor coupled to theinput system and configured to predict blood glucose levels based on thereceived data, and an output subsystem coupled to the blood glucoselevel predictor and configured to selectively generate output signalsbased on the received data and the predicted blood glucose levels. Inone embodiment, the system for predicting blood glucose levels furthercomprises a processor and a memory coupled to the processor and theblood glucose level predictor wherein the memory is configured togenerate predicted blood glucose levels from the received bloodglucose-related data. In one embodiment, the output signals comprisecontrol signals for controlling dispensing of insulin. In oneembodiment, the system for predicting blood glucose levels furthercomprises an insulin dispenser. In one embodiment, the output signalscomprise control signals for maintaining blood glucose levels within athreshold fasting range. In one embodiment, the output signals comprisecontrol signals for bringing blood glucose levels within the thresholdfasting range. In one embodiment, the output signals are control signalsfor selectively causing an alert signal to be generated.

In one embodiment, a method of predicting blood glucose levels comprisesreceiving historical data related to blood glucose levels, automaticallyanalyzing the historical data, and automatically predicting a futureblood glucose level based on the analysis. In one embodiment, the methodof predicting blood glucose levels further comprises receiving real-timeblood-glucose-related data, wherein the automatically analyzingcomprises comparing the real-time blood-glucose-related data to theanalyzed historical data. In one embodiment, the method of predictingblood glucose levels further comprises maintaining model parameters,wherein the automatically analyzing comprises applying the modelparameters. In one embodiment, maintaining the model parameterscomprises maintaining a fuzzy-logic table. In one embodiment,maintaining the model parameters comprises comparing real-timeblood-glucose-related data to historical data and selectively revisingthe model parameters based on the comparison. In one embodiment, theautomatically analyzing the historical data comprises calculating anactive insulin level. In one embodiment, the automatically analyzingcomprises comparing changes in blood glucose levels with time. In oneembodiment, the automatically analyzing comprises applying a probabilitymodel. In one embodiment, the automatically analyzing comprisesmaintaining a dynamic probability model.

In one embodiment, a method of dispensing insulin comprises receivingblood glucose data, generating blood glucose prediction data, comparingthe received blood glucose data to the generated blood glucoseprediction data, and generating control signals to control dispensing ofinsulin based on the comparison. In one embodiment, the method ofdispensing insulin further comprises adjusting control parameters basedon the comparison. In one embodiment, the generating control signalscomprises applying the control parameters. In one embodiment, thecontrol parameters are model parameters used to generate the bloodglucose prediction data. In one embodiment, the control parameterscomprise fuzzy-logic multipliers. In one embodiment, adjusting thecontrol parameters comprises adjusting a fuzzy logic rules matrix. Inone embodiment, the fuzzy logic rules matrix is adjusted according to adosing matrix coherency policy.

In one embodiment, a system for controlling the dispensing of insulincomprises a data input subsystem configured to received bloodglucose-related data, a blood glucose level predictor coupled to theinput system and configured to predict blood glucose levels based on thereceived data, a parameter adjuster, and an output subsystem configuredto generate control signals to control the dispensing of insulin basedon received data and the predicted blood glucose levels. In oneembodiment, the blood glucose level predictor is configured to predictblood glucose levels based on parameters of a statistical model and theparameter adjuster is configured to adjust the parameters of thestatistical model. In one embodiment, the output system is configured togenerate the control signals based on control parameters and theparameter adjuster is configured to adjust the control parameters. Inone embodiment, the parameter adjuster is configured to adjust thecontrol parameters based on a comparison of the predicted blood glucoselevels to the received data.

In one embodiment, a blood glucose control system comprises means forsensing indications of blood glucose levels, means for maintainingcontrol parameters, and means for generating output signals based onsensed indications of blood glucose levels and the maintained controlparameters communicatively coupled to the means for sensing indicationsof blood glucose levels and the means for maintaining controlparameters. In one embodiment, the means for generating output signalscomprises means for predicting blood glucose levels based on the sensedindications of blood glucose levels. In one embodiment, the bloodglucose control system further comprises means for dispensing insulin,wherein the output signals comprise control signals to control the meansfor dispensing insulin. In one embodiment, the means for sensingindications of blood glucose levels comprises a plurality of bloodglucose sensors. In one embodiment, the blood glucose control sensorfurther comprises means for receiving user input. In one embodiment, theblood glucose control sensor further comprises means for providingoutput data, wherein the output signals comprise control signals tocontrol the means for providing output data. In one embodiment, themeans for generating output signals is further configured to detect adangerous condition. In one embodiment, the dangerous condition is anactive insulin level above a threshold active insulin level and themeans for generating output signals is further configured to suspend thedispensing of insulin when the dangerous condition is detected. In oneembodiment, the dangerous condition is a predicted active insulin levelabove a threshold active insulin level and the means for generatingoutput signals is further configured to suspend the dispensing ofinsulin when the dangerous condition is detected. In one embodiment, themeans for generating output signals is configured to transition into asemi-automatic mode. In one embodiment, the means for generating outputsignals is configured to transition into a fully automatic mode. In oneembodiment, the means for generating output signals is configured todetect high blood glucose levels. In one embodiment, the means forgenerating output signals is configured to predict high blood glucoselevels. In one embodiment, the means for generating output signals isconfigured to selectively transition between a post-meal correction modeand a fasting mode. In one embodiment, the means for generating outputsignals is configured to selectively transition from the post-mealcorrection mode to the fasting mode when a fasting criteria issatisfied. In one embodiment, the means for generating output signals isconfigured to selectively transition from the fasting mode to thepost-meal correction mode when a prandial event is detected. In oneembodiment, the means for generating output signals is configured toselective transition from the fasting mode to a user-input mode when aprandial event is detected. In one embodiment, the control parameterscomprise model parameters. In one embodiment, the control parameterscomprise fuzzy-logic multipliers. In one embodiment, the means formaintaining control parameters is configured to selectively adjust afuzzy logic rules matrix. In one embodiment, the means for maintainingis configured to selectively adjust the fuzzy logic rules matrixaccording to a dosing matrix coherency policy. In one embodiment, themeans for generating is configured to predict a subsequent blood glucoselevel by treating a previously predicted blood glucose level as anactual blood glucose level. In one embodiment, the means for maintainingis configured to maintain a fuzzy-logic rules matrix based on the sensedindications. In one embodiment, the means for maintaining is configuredto maintain the fuzzy-logic rules matrix based on the sensed indicationsand previously predicted blood glucose levels. In one embodiment, themeans for generating is configured to predict blood glucose levels basedon the maintained fuzzy-logic rules matrix.

In one embodiment, an insulin dispensing system comprises means forsensing indications of blood glucose levels, means for dispensinginsulin, means for receiving user input, means for providing useroutput, and means for controlling the means for dispensing insulincommunicatively coupled to the means for sensing indications of bloodglucose levels, the means for receiving user input and the means forproviding user output, wherein the means for controlling the means fordispensing insulin is configured to automatically transition between apost-meal correction protocol and a fasting protocol based on sensedindications of blood glucose levels.

In one embodiment, the means for sensing indications of blood glucoselevels comprises a plurality of blood glucose sensors. In oneembodiment, the means for receiving user input comprises a keypad. Inone embodiment, the means for controlling the means for dispensinginsulin is further configured to detect a dangerous condition and tosuspend the dispensing of insulin when the dangerous condition isdetected. In one embodiment, the dangerous condition is an activeinsulin level above a threshold active insulin level.

In one embodiment, the means for controlling the means for dispensinginsulin is configured to control postprandial and fasting blood sugar inan insulin dependent diabetic and the sensed indications are compared toblood sugar targets which are a function of a level of compliance withan intensive insulin therapy protocol. In one embodiment, the means forcontrolling the means for dispensing insulin is configured to transitioninto a semi-automatic mode. In one embodiment, the means for controllingthe means for dispensing insulin is configured to transition into afully automatic mode. In one embodiment, the means for controlling themeans for dispensing insulin is configured to detect high blood glucoselevels. In one embodiment, the means for controlling the means fordispensing insulin is configured to predict high blood glucose levels.In one embodiment, the means for controlling the means for dispensinginsulin is configured to detect low blood glucose levels. In oneembodiment, the means for controlling the means for dispensing insulinis configured to predict low blood glucose levels.

In one embodiment, a blood glucose control system comprises a processor,a memory, a data input subsystem, a blood glucose level predictor, aparameter and model adjuster, an output subsystem, and a bus system. Inone embodiment, a blood glucose control system comprises a blood glucosesensor system configured to sense data indicative of blood glucoselevels; an insulin dispenser configured to selectively dispense insulinin response to a control signal; and a controller configured toselectively generate the control signal and communicatively coupled tothe sensor system. In one embodiment, the blood glucose control systemfurther comprises a user input device configured to receive user input.

In one embodiment, a system for dispensing insulin comprises a computingdevice having a computer-readable memory medium. In one embodiment, in asystem for dispensing insulin comprising a computing device having acomputer-readable memory medium, the contents of the computer-readablememory medium causes the computing device to perform a method fordispensing insulin. In one such embodiment, the method for dispensinginsulin comprises receiving blood glucose data; generating blood glucoseprediction data; comparing the received blood glucose data to thegenerated blood glucose prediction data; based on the comparison,generating control signals to control dispensing of insulin; and, basedon the comparison, adjusting control parameters.

In one embodiment, fuzzy logic control parameters may be automaticallyadjusted on the basis of a physician-defined ideal trajectory. In oneembodiment, a blood sugar prediction model may provide a method forautomatically adjusting fuzzy logic control parameters. In oneembodiment, the prediction model may be statistical. In one embodiment,a fuzzy logic controller may be adaptive. In one embodiment, a fuzzylogic controller may be based on a physician-defined blood sugartrajectory and/or based on a statistical model of a glucoregulatorysystem of a patient. In one embodiment, the blood sugar prediction modelmay be used in a device for alerting a patient.

The various embodiments disclosed herein may be employed, for example,as stand-alone systems or as components operative with one or moredisclosed components in an integrated blood sugar management system,such as a system for controlling the dispensing of insulin. Theembodiments may be combined in whole or in part to create additionalembodiments.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

In the drawings, identical reference numbers identify similar elementsor acts, unless the context indicates otherwise. The sizes and relativepositions of elements in the drawings are not necessarily drawn toscale. For example, the shapes of various elements and angles are notdrawn to scale, and some of these elements are arbitrarily enlarged andpositioned to improve drawing legibility. Further, the particular shapesof the elements as drawn are not necessarily intended to convey anyinformation regarding the actual shape of particular elements, and havebeen selected solely for ease of recognition in the drawings.

FIG. 1 is a functional block diagram of an embodiment of a dispensercontrol system.

FIG. 2 is functional block diagram of another embodiment of dispensercontrol system.

FIG. 3 is a functional block diagram of another embodiment of adispenser control system.

FIG. 4 is high-level hierarchical state diagram for an embodiment of amethod of operating a dispenser control system.

FIGS. 5A through 5C are a mid-level flow diagram for an embodiment of amethod of operating a dispenser control system.

FIG. 6 is a high-level flow diagram for an embodiment of a method ofpredicting an unsafe blood glucose level.

FIG. 7 is a high-level hierarchical state diagram for an embodiment of amethod of operating a dispenser control system.

FIG. 8 is a high-level state diagram for an embodiment of an examplemethod of operating a dispenser control system.

FIGS. 9A through 9C are a mid-level flow diagram for an embodiment of amethod of operating a dispenser control system.

FIG. 10 is a functional block diagram of an embodiment of a system forpredicting and controlling blood glucose levels.

FIG. 11 is a functional block diagram of an embodiment of a bloodglucose control system.

FIG. 12 illustrates an embodiment of a method of predicting bloodglucose levels.

FIG. 13 illustrates an embodiment of a system and method for controllingblood glucose levels.

FIG. 14 illustrates an embodiment of a method of training modelparameters for a blood glucose control system.

FIG. 15 illustrates an example of input data for an embodiment of asystem and method for predicting blood glucose levels.

FIG. 16 illustrates an embodiment of a blood glucose prediction method.

FIG. 17 illustrates an embodiment of a method of controlling an insulinpump that may be employed, for example, by the embodiments describedherein.

FIG. 18 illustrates blood sugar trajectories and associated correctionpercentages that may be employed, for example, by the embodimentsdescribed herein.

FIG. 19 illustrates an embodiment of a dosing rules matrix that may beemployed, for example, by the embodiments described herein.

FIG. 20 illustrates an embodiment of a method of controlling an insulinpump that may be employed, for example, by the embodiments describedherein.

FIG. 21 shows an example of blood glucose levels measured before andafter intake of a meal.

FIGS. 22A and 22B show an example of fuzzy coverings developed and usedin an embodiment of an insulin dose control method.

FIG. 23 illustrates an example of defuzzification of a fuzzy dose outputin an embodiment of an insulin dose control method.

DETAILED DESCRIPTION OF THE INVENTION

In the following description, certain details are set forth in order toprovide a thorough understanding of various embodiments of devices,methods and articles. However, one of skill in the art will understandthat other embodiments may be practiced without these details. In otherinstances, well-known structures and methods associated with bloodglucose sensors, data transmission, semiconductor devices, insulindispensers and control systems have not been shown or described indetail to avoid unnecessarily obscuring descriptions of the embodiments.

Unless the context requires otherwise, throughout the specification andclaims which follow, the word “comprise” and variations thereof, such as“comprising,” and “comprises,” are to be construed in an open, inclusivesense, that is as “including, but not limited to.”

Reference throughout this specification to “one embodiment,” or “anembodiment” means that a particular feature, structure or characteristicdescribed in connection with the embodiment is included in at least oneembodiment. Thus, the appearances of the phases “in one embodiment,” or“in an embodiment” in various places throughout this specification arenot necessarily referring to the same embodiment, or to all embodiments.Furthermore, the particular features, structures, or characteristics maybe combined in any suitable manner in one or more embodiments to obtainfurther embodiments.

The headings are provided for convenience only, and do not interpret thescope or meaning of this disclosure or the claimed invention.

FIG. 1 is a functional block diagram of a dispenser control system 100comprising a sensor system, which as illustrated is a blood glucosesensor system 102, a dispenser, which as illustrated is an insulindispenser 104, and a controller, which as illustrated is a blood glucosecontroller 106.

The blood glucose sensor system 102 is a device that measures bloodglucose levels or an indication of blood glucose levels. The bloodglucose sensor system 102 may operate with, or without, userinteraction, as discussed in more detail below. The blood glucose sensorsystem 102 may be configured to take periodic measures, such asmeasurements every fifteen minutes. The blood glucose sensor system 102may be configured to take measurements in response to received commands.The blood glucose sensor system 102 may be implanted, for example,subcutaneously, intramuscularly or intravenously. The blood glucosesensor system 102 may measure blood glucose levels directly orindirectly. For example, the blood glucose sensor system 102 may beconfigured to measure interstitial fluid glucose levels.

The blood glucose sensor system 102 as illustrated comprises one or moreblood glucose sensors 108, a communication system 110, which asillustrated comprises an antenna 112, an optional power system 114,which as illustrated comprises an optional rectifier 116 and an optionalbattery 118, and a data system 120, which as illustrated comprises aprocessor 122 and a memory 124. The blood glucose sensors 108 maymeasure blood glucose levels directly or indirectly. The use of multipleblood glucose sensors 108 facilitates detection of errors ormalfunctions, but multiple blood glucose sensors are not required. Othererror checking means may be employed, alone or in combination withmultiple glucose sensors, such as error detection routines stored in amemory, such as the memory 124, and executed by a processor, such as theprocessor 122.

The communication system 110 sends data signals and optionally sends andreceives data, control and power signals and may comprise bus systems,connectors, switches, wires, multiple antennas, multiple antenna arms,and parasitic elements, instead of or in addition to the illustratedantenna 112. Various data transmission methods and protocols may beemployed, such as, for example, serial bus signals, parallel bussignals, radio-frequency signals, infrared signals, amplitude modulationprotocols, and frequency modulation protocols. The power system 114provides power to the blood glucose sensor system 102 and may beconfigured to provide power in a passive and/or an active manner. Thedata system 120 is configured to generate output and/or control signalsin response to signals received from the blood glucose sensors 108and/or the communication system 110. In some embodiments, the datasystem 120 may comprise discrete circuitry in addition to, or insteadof, the illustrated processor 122 and/or the memory 124.

The insulin dispenser 104 is a device that dispenses insulin. Theinsulin dispenser 104 may operate with, or without, user interaction.The insulin dispenser 104 may be configured to supply insulin in avariety of ways, such as, for example, through an IV drip, throughsubcutaneous or intramuscular injection, through a pen-dispensingdevice, or through an inhaler.

The insulin dispenser 104 as illustrated comprises an insulin pump 126,an insulin reservoir 128, a communication system 130, which asillustrated comprises an antenna 132, an optional power system 134,which as illustrated comprises an optional rectifier 136 and an optionalbattery 138, and a control system 140, which as illustrated comprises aprocessor 142 and a memory 144.

The communication system 130 sends and receives data, control and powersignals and may comprise bus systems, connectors, wires, switches,multiple antennas, multiple antenna arms, and parasitic elements,instead of or in addition to the illustrated antenna 132. Various datatransmission methods and protocols may be employed, such as, forexample, serial bus signals, parallel bus signals, radio-frequencysignals, infrared signals, amplitude modulation protocols, and frequencymodulation protocols. The power system 134 provides power to the insulindispenser 104 and may be configured to provide power in a passive and/oran active manner. The control system 140 is configured to generatecontrol and/or output signals in response to signals received from theblood glucose sensor system 102 and/or the blood glucose controller 106via the communication system 130. In some embodiments, the controlsystem 140 may comprise discrete circuitry in addition to, or insteadof, the illustrated processor 142 and/or the memory 144.

The blood glucose controller 106 as illustrated comprises acommunication system 146, which as illustrated comprises an antenna 148and a transceiver 150, a power system 152, and a control system 154,which as illustrated comprises a processor 156, a memory 158, a userinterface controller 160, an input device 162, an output device 164, ablood glucose analyzer 166, and discrete circuitry 168.

The communication system 146 sends and receives data and control signalsand may comprise bus systems, connectors, wires, switches, multipleantennas, multiple antenna arms, and parasitic elements, instead of orin addition to the illustrated antenna 148 and transceiver 150. Thetransceiver 150 transmits and receives control and/or data signals. Forexample, the transceiver 150 may transmit control signals to the bloodglucose sensor system 102 and/or the insulin dispenser 104, and mayreceive data signals from the blood glucose sensor system 102 and/or theinsulin dispenser 104. The power system 152 provides power to the bloodglucose controller 106. The user interface controller 160 controls thereceipt of user input, which may be received from any suitable userinterface, such as the input device 162, which may comprise, forexample, a keypad, or from a remote device, such as the insulindispenser 104 via the communication system 146. User input data mayinclude indications of, for example, the weight of an individual, anindividual's body mass index, the medical condition of an individual, anindividual's insulin sensitivity, an individual's average daily insulindose, a meal estimate, a carbohydrate estimate for a meal, changes in anindividual's physical activity, changes in an individual's emotionalstate, prior insulin doses, the time of day, and other information andfactors pertinent to control of an individual's blood glucose level.

The user interface controller 160 also controls the output ofinformation, such as a warning signal or the display of informationentered by a user, which may be communicated to a user through anysuitable user interface, such as the user output device 164, which maycomprise, for example, a visual display, an audio system, and/or aprinter.

The blood glucose analyzer 166 analyzes data inputs and outputs, andhistories of data inputs and outputs, and generates control signals tocontrol the blood glucose controller 106 so as to facilitate control ofthe operation of the insulin dispenser 104 and/or to generateappropriate warning signals. For example, the blood glucose analyzer 166may use data received from the blood glucose sensor system 102 todetermine a current blood glucose level, an indication of a rate ofchange of the blood glucose level (e.g., a first time derivative),and/or an indication of an acceleration of the blood glucose level(e.g., a second time derivative). In another example, the blood glucoseanalyzer 166 may determine an active insulin level based on a history ofinsulin doses over a period of time and a projection of the reduction ininsulin activity for each dose in the history period based on the timethat has elapsed since the dose was administered. In another example, along-term history of blood glucose levels and insulin doses, alone ortogether with a history of user inputs, may be used by the blood glucoseanalyzer 166 to predict future blood glucose levels and to generatecontrol signals to control the blood glucose controller 106 so as tocontrol the operation of the insulin dispenser 104.

In some embodiments, the control system 154 may comprise discretecircuitry 168 in addition to, or instead of, the illustrated processor156, the memory 158, the user interface controller 160, and the bloodglucose analyzer 166. In the illustrated embodiment, the blood glucosesensor system 102, the insulin dispenser 104 and the blood glucosecontroller 106 are communicatively coupled together throughradio-frequency signals 170, 172, 174, 176. In other embodiments, theblood glucose sensor system 102, the insulin dispenser 104 and the bloodglucose controller 106 may be communicative coupled together throughother suitable means, such as a bus system, or through combinations ofmeans.

In one example mode of operation, the blood glucose controller 106queries (e.g., interrogates) one or more blood glucose sensor systems,such as blood glucose sensor system 102, with a wireless signal, such asan electromagnetic signal. The blood glucose controller 106 may be, forexample, configured to periodically interrogate one or more bloodglucose sensor systems, to interrogate one or more blood glucose sensorsystems in response to user input or a control signal, or variouscombinations thereof. In the embodiment as illustrated, the bloodglucose controller 106 broadcasts an RF interrogation signal 170. The RFinterrogation signal 170 may be modulated to carry data, instructions orcommands. For example, the RF interrogation signal 170 may be modulatedto carry a command directing the blood glucose sensor system 102 toreturn a signal indicative of a blood glucose level. The blood glucosesensor system 102 may extract power from the interrogation signal 170.The blood glucose sensor system 102 may extract power from the battery118. In response to the interrogation signal 170, the blood glucosesensor system 102 may respond to the interrogation signal 170 with aresponse signal. As illustrated in FIG. 1, the blood glucose sensorsystem 102 responds to the interrogation signal 170 with a responsesignal 174. The response signal 174 may be, for example, a modulationbackscatter signal conveying information indicative of a blood glucoselevel at a sample time period.

The blood glucose controller 106 receives the response signal 174 andextracts the information in the response signal 174 indicative of ablood glucose level. The blood glucose controller 106 may also receiveuser input. In response to the response signal 174, prior responsesignals, and/or any user input, the blood glucose controller 106 maygenerate one or more control signals to control the insulin dispenser104. As illustrated in FIG. 1, the blood glucose controller 106selectively transmits a radio-frequency control signal 172 to theinsulin dispenser 104. In response to the control signal 172, theinsulin dispenser 104 may dispense a specified amount of insulin at aspecified rate. The insulin dispenser 104 may extract power from thecontrol signal 172 and/or from the battery 138. The insulin dispenser104 may transmit one or more signals 176 to the blood glucose controller106, such as a signal confirming that a specified amount of insulin hasbeen dispensed at the specified rate.

In another example mode of operation, the blood glucose sensor system102 is configured to periodically transmit data, such as data embeddedin the illustrated radio-frequency signal 174, and the blood glucosecontroller 106 is configured to receive the data, for example byextracting the data from the radio-frequency signal 174, and to generateand transmit a control signal to control operation of the insulindispenser 104.

The data system 120 and the control systems 140, 154 may be implementedin a variety of ways, including as a combined control system or asseparate subsystems. The data system 120 and the control systems 140,154 may be implemented as one or more microprocessors, digital signalprocessors (DSP), application-specific integrated circuits (ASIC), orthe like, or as a series of instructions stored in a memory, such as thememories 124, 144, 158, and executed by a controller, such as theprocessors 122, 142, 156, or various combinations of the above. Thus,software modifications to existing hardware may allow the implementationof the dispenser control system 100. Various subsystems, such as theblood glucose analyzer 166, are identified as separate blocks in thefunctional block diagram of FIG. 1 because they perform specificfunctions that will be described in more detail below. These subsystemsmay be discrete units. For example, the data system 120 may beimplemented with a discrete circuit. The subsystems also may not bediscrete units but may be functions of a software routine, which willprobably, but not necessarily, be separately callable and identifiableelements. The various subsystems may be combined. For example, all orportions of the blood glucose analyzer 166 may be integrated into theuser interface controller 160. In another example, the blood glucosecontroller 106 may be combined with the insulin dispenser 104. Inanother example, the blood glucose sensor system 102, the insulindispenser 104 and the blood glucose controller 106 may be combined.

While the illustrated embodiment denotes a single processor 156 in theblood glucose controller 106, other embodiments may comprise multipleprocessors. Similarly, the illustrated embodiment shows three processors122, 142, 156 in the dispenser control system 100, a single processorcould be used on some embodiments. The memories 124, 144, 158 maycomprise, for example, registers, read only memory (“ROM”), randomaccess memory (“RAM”), flash memory and/or electronically erasableprogrammable read only memory (“EEPROM”), and may provide instructionsand data for use by the data system 120 and/or the control systems 140,154.

FIG. 2 is a functional block diagram of another embodiment of adispenser control system 200. The dispenser control system 200 comprisesa blood glucose sensor system 202 and an insulin dispenser 204comprising a blood glucose controller 206. Details of the blood glucosesensor system 202, the insulin dispenser 204 and the blood glucosecontroller 206 are omitted from FIG. 2 for ease of illustration. Theblood glucose sensor system 202 is communicatively coupled to theinsulin dispenser 204 through communication link 207. The communicationlink 207 may comprise, for example, radio-frequency communication links,a bus system, one or more wires, an infrared communication link orcombinations of various communication links.

FIG. 3 is a functional block diagram of another embodiment of adispenser control system 300. The dispenser control system 300 comprisesa plurality of blood glucose sensor systems 302, 376, a plurality ofblood glucose dispensers 304, 378, and a blood glucose controller 306.The components of the dispenser control system 300 are communicativelylinked together through communication links 380, 382, 384, 386, whichmay comprise, for example, radio-frequency communication links, a bussystem, one or more wires, an infrared communication link, orcombinations of various communication links. The blood glucosecontroller 306 comprises a control system 354, which as illustratedcomprises a processor 356, a memory 358, a blood glucose analyzer 366,an input device 362 and an output device 364. The input device 362accepts user input, such as data related to carbohydrate consumption orother information regarding an individual, and the output device 364provides information to the user, such as warnings, confirmation of userinput data, current and historical blood glucose levels, operationalmodes or presumptions (e.g., an indication the dispenser control system300 is in a regressive carbohydrate reduction mode or an indication thedispenser control system 300 has determined a monitored individual issleeping) or recommendations (e.g., a recommendation to postpone a mealor to limit a meal's carbohydrate content). The embodiment illustratedin FIG. 3 may be advantageously employed to monitor and control theblood glucose and/or active insulin levels in multiple individuals.

FIG. 4 is a high-level hierarchical state diagram 400 illustrating anexample method of an embodiment of controlling a dispenser controlsystem, such as the dispenser control systems 100, 200, 300 illustratedin FIGS. 1-3. For convenience, the state diagram 400 will be describedwith reference to the dispenser control system 100 illustrated inFIG. 1. The dispenser control system 100 is initiated at initiationstate 402. A user may typically initiate the dispenser control system100 just prior to consumption of a meal or when it is desirable to enterinformation regarding an individual.

The dispenser control system 100 transitions 404 from initiation state402 to a safety super-state 406 and enters a wait-for-user-input state408.

While in the safety super-state 406, the dispenser control system 100determines whether data generated or received by dispenser controlsystem 100 indicates that a dangerous condition exists. When thedispenser control system 100 determines in the safety super state 406that a dangerous condition exits, the dispenser control system 100 maybe configured to generate control signals to activate an alarm (e.g., avisual alarm, an audio alarm, a vibration alarm, a remote alarm, and/orcombinations of the above), which may vary based on the nature of thedangerous condition and/or the operational state of the dispensercontrol system, and to cause the dispenser control system 100 totransition to the wait-for-user-input state 408. For example, when thedispenser control system 100 determines that an individual is sleepingand that a dangerous condition has arisen, the dispenser control systemmay be configured to sound an alarm loud enough to wake the individual.The dispenser control system 100 may be configured to determine that adangerous condition exists in response to, for example: an indicationthat a monitored blood glucose level is below or above threshold levels;an indication that a predicted blood glucose level will be below orabove threshold levels; an indication of an equipment failure; or anindication of improbable blood glucose levels for an individual (forexample, blood glucose levels inconsistent with an individual's historyor historical glycemic profile, or with data received regarding anindividual, such as an indication of when a meal was consumed or acarbohydrate ratio of a meal).

In the illustrated state diagram 400, the dispenser control system 100also is configured to determine whether a dangerous condition exists bymonitoring the active insulin level in the monitor active insulin (AI)super-state 410, as discussed in more detail below. When the dispensercontrol system 100 determines in the monitor active insulin super state410 that a dangerous condition exits based on the monitoring of theactive insulin level, the dispenser control system 100 is configured togenerate control signals to active an alarm and to limit insulininfusion, and to transition to the wait-for-user-input state 408.

The threshold levels and ranges may be fixed or may be functions and maybe based on statistical analysis. For example, an indication of a bloodglucose level below a threshold level of 80 mg/dl may cause thedispenser control system 100 to determine that a dangerous conditionexists. In another example, an active insulin level above a thresholdlevel of 20 International Units (hereinafter insulin units) may causethe dispenser control system 100 to determine in the monitor activeinsulin super state 410 that a dangerous condition exists. An activeinsulin level may be determined based on a history of doses over aselected time period, with the impact of each dose adjusted using a formfactor indicative of the reduced insulin activity due to the timeelapsed since the dose was given. A threshold active insulin maximumlevel may be fixed or a function, and may be set using an adjustableinput parameter. Similarly, the determination of whether a blood glucoselevel is improbable may be based on thresholds, functions andstatistical analysis. Look-up tables, fuzzy logic and/or neural networksmay be employed, for example. Indications of equipment failure mayinclude direct indications (for example, an error signal from theinsulin dispenser 104), or indirect indications (for example,inconsistent indications of blood glucose levels from multiple bloodglucose sensors 108 in a blood glucose sensor system 102, or anindication that a pump is not operating properly, such as an indicationan insulin dispenser 104 is not responding to a control signal).

In the state diagram illustrated in FIG. 4, when the dispenser controlsystem 100 determines that a dangerous condition exists, the dispensercontrol system 100 may be configured to trigger an alarm (such as analarm by the user output 164 and/or a remote alarm) and to enter thewait-for-user-input state 408.

The dispenser control system 100 is configured to enter thewait-for-user-input state 408 when the dispenser control system 100 isinitiated, when invoked by the user (for example, when the user wishesto enter information such as information regarding a meal), which may beat the same time as initiation, or in response to a dangerous conditionor an anomaly being detected. In the wait-for-user-input state 408, thedispenser control system 100 is configured to wait for user input. Thedispenser control system 100 may be configured to prompt the user forinput, and may be configured to signal an alarm. For example, when thewait-for-user-input state 408 is entered from the safety super-state 406or the monitor AI super state 410, the dispenser control system 100 maybe configured to signal an alarm. The dispenser control system 100 maybe configured to time-out if no user input is received within athreshold period of time. For example, when the wait-for-user-inputstate 408 is entered from initiation state 402, the dispenser controlsystem 100 may be configured to wait for a threshold period of time forinput from a user, and then transition to another state such as the PostMeal Correction state 412 or the insulin dose control state 414 ifcertain conditions are satisfied, as discussed in more detail below. Thedispenser control system 100 may be configured to respond to directcommands to dispense particular amounts of insulin, and may be furtherconfigured to require confirmation if a commanded dose is inconsistentwith an actual or predicted blood glucose level or an active insulinlevel. For example, the dispenser control system 100 may be configuredto return 401 to the user-input state 408 in response to a command thatis inconsistent with data.

The user input may include information regarding a meal about to beconsumed, a meal recently consumed, or information about an individual,as discussed above. When the information includes information regardinga meal that is about to be consumed, the dispenser control system 100may be configured to generate control signals to cause the insulindispenser 104 to dispense a bolus dose (or a pre-meal dose) of insulin.The bolus dose may be calculated using known methods using factors thatmay include, for example, insulin sensitivity and a carbohydrate ratio.The dispenser control system 100 may also be configured to generatecontrol signals to cause the insulin dispenser 104 to dispense insulindoses during a fasting period.

The dispenser control system 100 may be configured to transition 422from the wait-for-user-input state 408 to the Post Meal Correction state412 when it is determined that sufficient time, for example T_threshold,has passed since insulin has been infused, and the blood glucose levelis or predicted to be within the threshold range for post mealcorrections to begin. The actual blood glucose threshold range fortransitioning from the wait-for-user-input state 408 to the Post MealCorrection state 412 may be determined by an event that initiated thewait-for-user-input state. Threshold values for instances of thewait-for-user-input state that that are initiated by carbohydrateentries are lower than instances of the state initiated by a meal signalonly. Instances of the wait-for-user-input state that that are initiatedby user-initiated boluses may have lower threshold values than instancesinitiated by meal only signals. These three threshold values may bephysician-set during the patient's enrollment process. See Table 3. Themore the patient complies with intensive insulin therapy, the lower thethreshold values.

The more information that a user, such as a patient, tells the systemabout a meal, for example, the lower the blood sugar targets that may beset. For example, if the patient estimates the meal carbs, the bloodsugar target may be lower than if the patient only signals the meal,which may be lower than if the patient provides no information at allabout the meal. The blood sugar targets are typically on a per mealbasis, which means if a normally compliant patient estimates the carbsof their breakfast meal but forgets to estimate or signal their dinnermeal, the blood sugar target for dinner is higher than breakfast. Thissame concept can be applied to non-meal or fasting periods.

As illustrated, the wait-for-user-input state 408 is within the safetysuper state 406. Thus, the dispenser control system 100 will nottransition from the wait-for-user input state 408 to another state if adangerous condition exists, and if it is determined that a dangerouscondition has developed while the dispenser control system 100 is in thewait-for-user-input state 408, the dispenser control system 100 may beconfigured to generate control signals to activate an alarm.

In the Post Meal Correction state 412, the dispenser control system 100is configured to periodically determine whether an additional bolus doseshould be provided, or whether the conditions are such that thedispenser control system 100 should transition 424 to the insulin dosecontrol state 414. For example, if an acceleration of blood glucoselevel indicates an insufficient bolus dose was provided, the dispensercontrol system 100 may be configured to dispense an additional bolusdose.

The dispenser control system 100 may be configured to transition 424from the Post Meal Correction state 412 to the insulin dose controlstate 414 when threshold safety conditions are satisfied. For example,if the history is consistent with a sufficient post-prandial period, theblood glucose level is or is predicted to be within a safe thresholdrange (e.g., between 90 and 140 mg/dl), and the active insulin level isbelow a threshold (e.g., 20 insulin units).

As illustrated, the Post Meal Correction state 412 is within the safetysuper state 406 and the monitor active insulin super state 410. Thedispenser control system 100 is configured to activate an alarm andtransition 428 from the Post Meal Correction state 412 to thewait-for-user-input state 408 when it is determined that a dangerouscondition exists. For example, if the blood glucose level is or ispredicted to be outside of a threshold range (e.g., between 90 and 140mg/dl), and the active insulin level is or is predicted to be above athreshold (e.g., 20 insulin units). Further, if the determination that adangerous condition exists is based in part on a determination that anactive insulin level exceeds a threshold level, the dispenser controlsystem 100 may be configured to limit insulin infusion. For example, thedispenser control system 100 may limit insulin infusion to a thresholdamount for a threshold period of time. The dispenser control system 100may be configured to transition 417 from the Post Meal Correction state412 to the wait-for-user-input state 408 in response to commandsreceived by the dispenser control system 100 (e.g., a command entered bya user, for example, an indication that a meal is about to be consumedwithout entering the estimated carbs for that meal.) The dispensercontrol system 100 may be configured to transition 418 from the PostMeal Correction state 412 to the wait-for-user-input state 408 inresponse to commands received by the dispenser control system 100 (e.g.,a command entered by a user, for example, an indication that a meal isabout to be consumed by entering the estimated carbs for that meal.) Thedispenser control system 100 may be configured to transition 420 fromthe Post Meal Correction state 412 to the wait-for-user-input state 408in response to commands received by the dispenser control system 100(e.g., a command entered by a user, for example, an indication that auser-initiated manual correction bolus was entered.)

The dispenser control system 100 may be configured to transition 424from the Post Meal Correction state 412 to the insulin dose controlstate 414 when it is determined that sufficient time has passed sincepost meal corrective doses have been infused, and the blood glucoselevel is or is predicted to be within the threshold range for fullyautomatic insulin dosing control to begin. The actual threshold rangefor transitioning from the Post Meal Correction state 412 to the insulindose control state 414 may be determined by an event that initiated thePost Meal Correction state. For example, to the extent the patientcomplies with intensive insulin therapy, lower threshold values may beemployed.

The dispenser control system 100 may be configured in the insulin dosecontrol state 414 to monitor blood glucose levels and to periodicallydispense insulin based on the current blood glucose level and thehistory of the monitored blood glucose levels. The dispenser controlsystem 100 may be configured to dispense insulin based on otherinformation about an individual, as discussed above. The dispensercontrol system 100 may employ, for example, fuzzy logic, a neuralnetwork, a look-up table, software routines or combinations thereof toperiodically dispense insulin based on the history of the monitoredblood glucose levels and other information.

Table 1 illustrates an example fuzzy logic Dosing Rules Matrix that maybe applied by the dispenser control system 100 to control the dispensingof subcutaneous insulin while in the insulin dose control state. Thedosing identifiers in Table 1 represent experimentally distinct doses ofinsulin, which may be measured in Units of Insulin. The dosingidentifiers from largest dose to smallest dose are D90 (very large) toD01 (very small). The first fuzzy input is the current blood glucoselevel BGL in mg/dl units, represented in the bottom four rows with fuzzycoverings BV (very high), BH (high), BM (medium), and BN (normal). Thesecond fuzzy input is the rate of change of the blood glucose level,represented in row BGL RATE with fuzzy coverings RN (negative), RZ(zero), RP (positive) and RV very positive. The third fuzzy variable isacceleration of the blood glucose level, represented in row BGLAcceleration with fuzzy coverings AN (negative), AZ (zero) and AP(positive). Example trajectories corresponding to the blood glucoselevel rate of change and acceleration are illustrated in row BGLTrajectory. The fuzzy coverings may be experimentally determined, andmay vary based on additional factors such as the method of delivering adose of insulin.

TABLE 1 EXAMPLE DOSING RULES MATRIX BGL Rate: RN RZ RP RV BGLAcceleration: AN AZ AP AN AZ AP AN AZ AP AN AZ AP BGL Trajectory:

BGL BV D01 D10 D70 D01 D20 D80 D01 D80 D80 D01 D90 D90 BH D01 D10 D20D01 D20 D50 D01 D80 D80 D01 D90 D90 BM D01 D05 D10 D01 D10 D20 D01 D40D40 D01 D80 D90 BN D01 D05 D01 D01 D02 D05 D01 D05 D10 D01 D05 D10

The dispenser control system 100 may be configured to transition 411from the insulin dose control state 414 to the wait-for-user-input state408 in response to commands received by the dispenser control system 100(e.g., a command entered by a user, for example, an indication that ameal is about to be consumed without entering the estimated carbs forthat meal.) The dispenser control system 100 may be configured totransition 413 from the insulin dose control state 414 to thewait-for-user-input state 408 in response to commands received by thedispenser control system 100 (e.g., a command entered by a user, forexample, an indication that a meal is about to be consumed by enteringthe estimated carbs for that meal.) The dispenser control system 100 maybe configured to transition 415 from the insulin dose control state 414to the wait-for-user-input state 408 in response to commands received bythe dispenser control system 100 (e.g., a command entered by a user, forexample, an indication that a user-initiated manual correction bolus wasentered.)

As illustrated, the insulin dose control state 414 is within the safetysuper state 406 and the monitor active insulin super state 410. Thedispenser control system 100 is configured to activate an alarm andtransition 430 from the insulin dose control state 414 to thewait-for-user-input state 408 when it is determined that a dangerouscondition exists. For example, if the blood glucose level is or ispredicted to be outside of a threshold range (e.g., between 90 and 140mg/dl), and the active insulin level is or is predicted to be above athreshold (e.g., 20 insulin units). Further, if the determination that adangerous condition exists is based in part on a determination that anactive insulin level exceeds a threshold level, the dispenser controlsystem 100 may be configured to limit insulin infusion. For example, thedispenser control system 100 may limit insulin infusion to a thresholdamount for a threshold period of time.

Embodiments of the method of operating a dispenser control systemillustrated by the hierarchical state diagram 400 of FIG. 4 may notcontain all of the illustrated states, superstates and transitions, maycontain additional states, superstates and transitions, or may combineor separate illustrated states and superstates. For example, the PostMeal Correction state 412 and the insulin dose control state 414 may becombined into an automatic dose control state in some embodiments. Thethreshold levels and ranges discussed with respect to FIG. 4 may befixed or may be functions and may be based on statistical analysis.

An example embodiment of an IDC method and its application is providedin Example 1.

Personalization

Insulin dosing may be adjusted to be appropriate for a particularpatient, or personalized. For example, the details of a basic IDC designmay be set as if they applied to a nominal or standard patient, with acapability to adjust one or more parameters of that design for eachparticular patient.

An example of a personalization parameter is an overall multiplier ofthe IDC dose listed as Mult_per in an enrollment table. An example IDCmethod is designed to be appropriate for an active 20-year-old male of75 kg weight, with an average daily dose of insulin of 49.9 units. Forthat patient no adjustment is necessary and the Mult_per is 1.0. Threeexample methods for choosing an adjusted value of Mult_per for a patientare given.

The first example method is to determine Mult_per by the patient'sweight. For example:

Mult_per=weight/75, where the weight is given in kgs.

A second example method is to use the average daily insulin dose of thepatient recorded over the previous week. A patient starting use of anICD controlled insulin pump may already have experience with a manuallycontrolled insulin pump which records the total of the insulin dosesreceived each day. Those totals, averaged over a week, are compared tothe standard patient's average daily dose to yield the multiplier. Forexample:

Mult_per=(TDD for new patient)/(TDD for standard patient)

which, for the example standard patient is:

Multi_per=(TDD for new patient)/(49.9 units).

The third example method may be called the ABCD method, where “A,” “B,”“C” and “D” characterize the blood sugar vs. time graph resulting fromthe standard patient's response to consuming a particular amount ofcarbohydrate normalized by body weight.

The “A” term represents the maximum peak blood sugar; “B” is the timerequired to reach the maximum; “C” represents the “A” value minus thesteady state blood sugar recorded after consuming the carbohydrate, and“D” is the time required to achieve the steady state blood sugar. Inthis example method the particular patient consumes the same amount ofcarbohydrate, normalized to their body weight and their deltas to thestandard patient ABCD values are recorded. The particular Mult_per for apatient may be determined, for example, on a case by case basis by aphysician's analysis of the ABCD deltas.

From time to time there may be a need to change Mult_per if the patienthas a significant change in health status or activity level. Examplesare: change from sedentary to active life style or vice versa, entranceinto puberty, entrance into menopause or a large change in weight.

Embodiments of the state diagram illustrated in FIG. 4 may containadditional states not shown in FIG. 4, may not contain all of the statesillustrated in FIG. 4, may contain additional transitions notillustrated in FIG. 4, may not contain all of the transitionsillustrated in FIG. 4, and may combine or separate states illustrated inFIG. 4. For example, the dispenser control system 100 may be configuredto set an alarm and transition to the user-input state 408 whenever anerror is detected, such as an equipment malfunction, or if unsafe bloodglucose levels are detected or predicted (e.g., blood glucose levelsoutside a threshold range, or blood glucose levels above a threshold incombination with a rate of increase in the blood glucose level that isabove a threshold rate of increase, or blood glucose level that ispredicted to be unsafe using statistical methods, such as thosedescribed herein). The threshold levels and ranges discussed withrespect to FIG. 4 may be fixed or may be functions and may be based onstatistical analysis.

FIGS. 5A through 5C illustrate a mid-level flow diagram of an embodimentof a method 500 that may be employed by a dispenser control system, suchas the dispenser control systems 100, 200 and 300 illustrated in FIGS. 1through 3, to control the dispensing of insulin. For convenience, themethod will be described with respect to the embodiment of a dispensercontrol system 100 illustrated in FIG. 1.

The dispenser control system 100 initializes the method 500 at 402. Themethod 500 proceeds from 402 to 504. At 504, the dispenser controlsystem 100 requests user input and optionally provides information tothe user.

At 504, the dispenser control system 100 determines whether there is anindication of user input. For example, the user may enter dataindicating a prandial event is about to occur, with or without anindication of a carbohydrate content of the meal, or may enter dataindicating a BGL correction bolus. In the case of a compliant patientthe insulin dose may be calculated 413 asCarb_compliant*Carb_bolus_factor. In the case of a semi-compliantpatient the insulin dose may be calculated 411 based on which timewindow is active (T_breakfast, T_lunch, T_dinner or T_other) and thecorresponding assumed carb (Carb_breakfast, Carb_lunch, Carb_dinner,Carb_other). In the case of a manual correction the insulin dose may becalculated 415, for example, by(BGL_current-BGL_correction)*BGL_corr_factor or by a direct insulin doseentry. The method then proceeds from 504 to 506.

At 506, the dispensing control system 100 instructs the insulin pump todeliver the insulin dose calculated in 504. The method proceeds from 506to 508 in the case of a meal indication or 510 in the case of a manualcorrection.

At 508, the dispenser control system 100 determines whether sufficienttime has elapsed since the postprandial infusion event. The dispensercontrol system 100 may determine whether sufficient time has elapsed by,for example, comparing the elapsed time T_prandial to a threshold timeT_threshold (e.g., 120 minutes). When the dispenser control system 100determines that a sufficient amount of time has elapsed since theprandial event, the method proceeds from 508 to 510. In someembodiments, high BGL readings may be ignored during this time.

At 510, the dispensing control system 100 determines whether adangerously high blood glucose condition exists or is predicted. Thedispensing control system 100 may, for example, determine that adangerously high blood glucose condition exists if an indication of acurrent blood glucose level exceeds a threshold amount BGL_high (e.g.,180 mg/dl) and a rate of change of the blood glucose level exceeds athreshold rate of change (e.g., an increase of 50 mg/dl over fifteenminutes). The dispensing control system 100 may, for example, determineby statistical methods, such as those described herein, that adangerously high blood glucose condition is predicted to exceed athreshold. When the dispensing control system 100 determines that adangerously high blood glucose condition exists, the method proceedsfrom 510 to 514. At 514, the dispensing control system 100 setsappropriate warning flags. For example, the dispensing control system100 may set a flag to cause the output device to sound an alarm. Themethod then proceeds from 514 to 504. When the dispensing control system100 determines that a dangerously high blood glucose condition does notexist, the method proceeds from 510 to 512.

At 512, the dispensing control system 100 determines whether adangerously low blood glucose condition exists. The dispensing controlsystem 100 may, for example, determine that a dangerously low bloodglucose condition exists if an indication of a current blood glucoselevel is lower than a threshold amount, BGL_low (e.g., 80 mg/dl) and arate of change of the blood glucose level falls below a threshold rateof change (e.g., a decrease of 30 mg/dl over fifteen minutes). Thedispensing control system 100 may, for example, determine by statisticalmethods, such as those described herein, that a dangerously low bloodglucose condition exceeds or is predicted to exceed a threshold. Whenthe dispensing control system 100 determines that a dangerously lowblood glucose condition exists, the method proceeds from 512 to 516. At516, the dispensing control system 100 sets appropriate warning flags.For example, the dispensing control system 100 may set a flag to causethe output device to sound an alarm and suspend insulin infusion. Themethod then proceeds from 516 to 504. When the dispensing control system100 determines that a dangerously low blood glucose condition does notexist, the method 500 transitions via 422 to 520.

At 514, the dispenser control system 100 signals the user that the bloodglucose level is too high and transitions to 504.

At 516, the dispenser control system 100 signals the user that the bloodglucose level is too low and proceeds from 516 to 518.

At 518, the dispenser control system 100 suspends insulin delivery. Themethod then proceeds from 518 to 504.

At 520 the PMC state is entered and the target BGL levels to transitionto the IDC state are determined or retrieved. The criteria fordetermining when to transition from PMC to IDC may depend, for example,on how the PMC state was entered. For example, if the PMC state wasinitiated by a Carb User-Input, then the BGL transition levels(BGL_high_trans, BGL_med_Trans, BGL_low_trans) may be set to a lowestlevel. This may be viewed as a the compliant control mode. In anotherexample, if the PMC state was initiated by a Meal signal User-Input,then the BGL transition levels (BGL_high_trans, BGL_med_Trans,BGL_low_trans) may be set higher. This may be viewed as a thesemi-compliant control mode. In another example, if the PMC state wasinitiated by a Manual bolus User-Input, or from No patient input, thenthe BGL transition levels (BGL_high_trans, BGL_med_Trans, BGL_low_trans)may be set to a highest level. This may be viewed as a Non-compliantcontrol mode.

These targets may be set, for example, by a physician during anEnrollment process. See Table 2. The method proceeds to 522.

At 522 the current BGL is compared to the BGL_trans_high leveldetermined or retrieved in 520. If the BGL is above this level themethod proceeds to 532. If not the method proceeds to 524.

At 524, the dispensing control system 100 determines whether a post mealcorrection is desirable, for example, by comparing it to theBGL_med_trans level set in 520. The dispensing control system 100 may,for example, determine that post meal correction is desirable if anindication of a current blood glucose level exceeds a threshold amountBGL_trans_med and a rate of change of the blood glucose level exceeds athreshold rate of change (e.g., an increase of 10 mg/dl over fifteenminutes). When the dispensing control system 100 determines that postmeal correction is not necessary, the method proceeds from 524 to 526.

At 526 the current BGL is compared to the BGL_trans_low level set in520. If the BGL is below this level the method proceeds to 530. If notthe method transitions via 424 to 534.

At 530, the dispenser control system 100 signals the user that the bloodglucose level is too low and transitions via 427 from 530 to 504.

At 532, the dispenser control system 100 signals the user that the bloodglucose level is too high and transitions via 428 to 504.

At 534, the dispensing control system 100 determines or retrieves thetarget BGL. These may be set based upon the entry condition, forexample, to BGL_comp for entry from the compliant mode, to BGL_semi forentry from the semi-compliant mode, and to BGL_non for entry from thenon-compliant mode. Also the BGL fuzzy covering may be shifted from thebaseline based on the target BGL. BGL_comp, BGL_semi, and BGL_non aswell as other items may be constants and may be initialized by thephysician according to an enrollment process such as defined below. Themethod proceeds from 534 to 536. The values may depend on how a PMCstate was entered. For example, the IDC target BGL may be set lowestwhen the PMC state was initiated by a user carbohydrate input, to ahigher level when the PMC state was initiated by a meal-signal userinput, and to a highest level when the PMC state was initiated by amanual bolus user input or no input.

At 536, the dispensing control system 100 receives a recently measuredvalue of the blood glucose level from the sensor. The measurements maynormally be taken at a fixed time interval, but this is not required.The method proceeds from 536 to 538.

At 538, the dispensing control system 100 calculates the rate andacceleration. Bi is the BGL value at the current time Ti, Bi−1 is theBGL value at the previous time Ti−1. The rate, Ri, and the acceleration,Ai, may be calculated as follows: Ri=(Bi−Bi−1)/(Ti−Ti−1). Ai=2(Ri−Ri−1)/(Ti−Ti−2) (This definition can account for variable timesteps.) The method proceeds from 538 to 540.

At 540, the dispensing control system 100 fuzzifies the blood glucoselevel, the blood glucose rate and the blood glucose acceleration. Thismay be done, for example, by applying the fuzzy coverings of Table 2 tothe values of blood glucose level, blood glucose rate, and blood glucoseacceleration. This yields a set of truth-values for the appropriatefuzzy members. The method proceeds from 540 to 542.

At 542, the dispensing control system 100 applies fuzzy logic rules todetermine a fuzzy insulin control dose. For example, the dispensingcontrol system 100 may apply the fuzzy logic rules illustrated inTable 1. This yields the fuzzy insulin control dose, which isrepresented by a set of truth-values for the appropriate members of thedose fuzzy covering. The method proceeds from 542 to 544.

At 544, the dispensing control system 100 calculates the insulin dose bydefuzzifying the fuzzy insulin control dose. The dose value may becalculated, for example, by determining the centroid of the fuzzyinsulin control dose. (Centroid is sometimes called center of mass orcenter of area.) The method proceeds from 544 to 546.

At 546, the dispensing control system 100 personalizes the insulincontrol dose by applying formula, which may be a simple formula such asmultiplication by a constant parameter. The value of that parameter maybe set, for example by a physician at enrollment and based on personalinformation regarding the individual. For example, it may be desirableto adjust the dosage based on the weight of an individual, that person'shistorical average insulin dose or other personal characteristicsdetermined in laboratory testing. The method proceeds from 546 to 548.

At 548, the dispensing control system 100 displays the recent bloodglucose history and the personalized insulin control dose. The methodproceeds from 548 to 550.

At 550, a predicted BGL value, for example, a short time in the future,is calculated. This predicted value may be based on statistical analysisof the long-term BGL history or an extrapolation of the recentlymeasured BGL data. The method proceeds from 550 to 552.

At 552, both the current BGL value and the predicted BGL value arecompared to BGL_high, the high BGL safety threshold. (BGL_high may beset, for example, by a physician at enrollment.) If the threshold isexceeded the method proceeds to 556. Otherwise the method proceeds to554.

At 554, both the current BGL value and the predicted BGL value arecompared to BGL_low, the low BGL safety threshold. (BGL_low may be set,for example, by a physician at enrollment.) If the threshold is exceededthe method proceeds to 560. Otherwise the method proceeds to 558.

At 556, the dispensing control system 100 signals the high BGL, whichmay include displaying the high BGL safety condition as a text messageand also as an aural signal. The method proceeds to transition 430 to504.

At 558, the dispensing control system 100 signals the low BGL, which mayinclude displaying the low BGL safety condition as a text message andalso as an aural signal. The method proceeds to transition 429 to 504.

At 560, the dispensing control system 100 instructs the insulin pump todeliver the personalized insulin control dose. The method proceeds from560 to 536.

Embodiments of the method illustrated in FIGS. 5A through 5C may containadditional acts not shown in FIGS. 5A through 5C, may not contain all ofthe acts shown in FIGS. 5A through 5C, may perform acts shown in FIGS.5A through 5 c in various orders, and may combine acts shown in FIGS. 5Athrough 5 c. References to the states of FIG. 4 and to the systems ofFIG. 1 in the description of FIG. 5 are intended as examples only.

An example enrollment procedure, which may be performed by or under thedirection of a physician, is shown in Table 2 below. For convenience, itwill be described as performed by a physician. The physician may use anenrollment procedure when an individual patient starts using embodimentsof the automatic insulin delivery device described herein. The physicianmay decide the appropriate numerical value or ranges for variables andsettings, such as control thresholds, that are appropriate for thatindividual and enter those values or ranges into an enrollment database.In some embodiments, the ability to enter the enrollment data may belimited to the physician and other designated medical personnel andprotected, for example, by a password.

TABLE 2 EXAMPLE ENROLLMENT DATA Variable Example Value DescriptionBGL_comp 110 mg/dL BGL target for IDC during compliant mode BGL_semi 140mg/dL BGL target for IDC during semi-compliant mode BGL_non 175 mg/dLBGL target for IDC during non-compliant mode BGL_low 80 mg/dL Low BGLThreshold for safety purposes BGL_med 150 mg/dL Medium BGL ThresholdBGL_high 180 mg/dL High BGL Threshold for safety purposes T_threshold120 minutes Time to wail following a meal before entering the PMC state.Carb_breakfast 40 g Assumed carb count for semi- compliant patient atbreakfast T_breakfast 6:00 to 9:59 Time window for breakfast Carb_lunch60 g Assumed carb count for semi- compliant patient at lunch T_lunch10:00 to 14:59 Time window for lunch Carb_dinner 100 g Assumed carbcount for semi- compliant patient at dinner T_dinner 15:00 to 20:59 Timewindow for dinner Carb_other 30 g Assumed carb count for semi- compliantpatient at other time T_other 21:00 to 5:59 Time other than T_breakfast,T_lunch or T_dinner Al_max 21 units Active insulin cutoff T_insulin 205minutes Insulin activity time Mult_per 0.87 Personalization multiplierCarb_compliant 50 g Carbohydrate entered for a meal by compliant patientCarb_bolus_factor 1/10 U/g The carb bolus factor for a compliant patientBGL_correction 120 mg/dL The target BGL for a patient in need of a BGLcorrection BGL_current 200 mg/dL The BGL indicated at the most currentreading BGL_corr_factor 1/50 U/(mg/dL) The BGL correction factor for apatient T_prandial 100 minutes Elapsed time from a prandial eventBGL_trans_high 180 mg/dL High transition level from PMC to IDCBGL_trans_med 130 mg/dL Medium transition level from PMC to IDCBGL_trans_low 100 mg/dL Low transition level from PMC to IDC

The system may be configured to predict when a particularinsulin-dependent diabetic will experience hypo- or hyper-glycemia witha probability greater than some patient-specific, predetermined,settable alerting threshold. The techniques used here can be modified topredict other BGL related target values or trends expressed in terms ofsequences of blood sugar values.

Hidden Markov Models (HMMs) are statistical models of sequential datathat have been used successfully in many machine-learning applications,especially for speech recognition. [L. R. Rabiner, “A tutorial on hiddenMarkov models and selected applications in speech recognition,”Proceedings of the IEEE, vol. 77, no. 2, pp. 257-286, 1989.]

The same techniques may be applied to the modeling the interaction ofinsulin and blood glucose in diabetics. An example application of HMMtechniques is described below.

If the range of BGL values are partitioned into groups of, for example,ten, we may view the over-time dynamics of blood sugar as a timesequence of discrete state transitions, where each integer BGL value isthe state. Suppose a patient's BGL is measured every fifteen minutes,and the last four measurements were 95, 111, 130 and 139, then thesequence S would be

s(1)=95,s(2)=111,s(3)=130,s(4)=139

When using today's blood glucose sensors, without loss of generality,blood sugar measurements may be placed into groups of 10 wherebg1=[10-19], bg2=[20-29], bg3=[30-39] and so on. In general, forpositive integer N, bgN=[N*10, N*10+9]. Using the broader states theabove sequence reads

s(1)=bg9,s(2)=bg11,s(3)=bg13,s(4)=bg13

For a diabetic who subcutaneously infuses insulin, their Active Insulin(AI), or Insulin on Board, at any particular time, is a number thatrepresents the amount of insulin in their body that is available tolower blood sugar. Because each dose of insulin generally produceseffects for 8 hours, the AI number represents the cumulative effects,i.e., the “stacking” of the previous 8 hours of dosing.

The Active Insulin at time t for any patient may be expressed as:

AI(tc)=ΣDi F(tc−ti)

where Di, ti are the set of doses at times ti. F(t) is the attenuationfactor for a dose earlier than the current time by t hours. There is noattenuation for a dose at the current time [F(t)=1.0]. A dose that iseight or more hours previous to the current time is completelyattenuated [F(t)=0.0]. In between F(t) is a smooth curve given by theformula:

F(t)=Σcj t**j

The coefficients for this polynomial of degree 6 are:

-   -   c0=0.9998    -   c1=0.045    -   c2=0.184    -   c3=0.0485    -   c4=0.005172    -   c5=0.0002243    -   c6=0.00000215

Because it is normally a decimal fraction, for simplicity the ai valuecan be set to the greatest integer less than its calculated value.

The BGL observation state space for a given patient may be expressed asa mathematical set: BG={bg|bg has the form bgj=[j*10, j*10+9] wherepositive integer j has min<=j<=max, and min and max are selected torepresent the total range of blood glucose values for that patient}

For a patient whose blood sugar measurements are always between 55 and433 mg/DL, their state space may be expressed as {5, 6, 7, . . . 43}

The BGL hidden state space for a given patient may be expressed as

BG-HMM={(bg,ai)|bg is as above and ai is the calculated Active Insulinat the time the blood glucose was measured.}

The BGL hidden state space for a given patient may be constructed asfollows. Sufficient historical blood sugar measurement information for apatient is loaded into a database, along with insulin infusioninformation as downloaded from an insulin infusion pump. The blood sugarinformation may be frequent enough to obtain measurements for everyfifteen-minute time interval. By correlating the blood sugarmeasurements with the insulin infusion records, the ai (Active Insulin)number is calculated for each bg (blood glucose) measurement. Similarly,the state transition probability for each (bg,ai) state can becalculated. See the Rabiner paper or any Markov Model textbook for statetransition matrix construction details. The state transition matrix is asquare matrix where the row and columns correspond with the states. Theelements of row j, for example, are numbers between 0.0 and 1.0, the sumof which total 1.0. If the i-th element in row j is 0.3, that means thatthere is a 0.3 probability of transitioning from state j to state i. Thesum of each row elements is 1.0 because it is true that given any state,you must transition somewhere.

To make every state in a patient's model accessible, we can choose theBGL and AI granularity to be wide enough; like 20+/−BGL and +/−AI. Themore historical data available for a particular patient, the finer thegranularity can be.

The Viterbi algorithm is a dynamic programming algorithm for finding themost likely sequence of hidden states—known as the Viterbi path—thatresult in a sequence of observed states. The list of possible sequencesin the space is restricted to those that are physiologically possiblefor the patient, and is unique to each patient.

FIG. 6 illustrates an embodiment of a method 600 of operating a system,such as the dispenser control systems 100, 200, 300 illustrated in FIGS.1-3, to predict hypoglycemia in a patient. This may be done, forexample, by predicting the probability that a sequence of observedstates will produce a blood glucose level at or below a thresholdBG_(MIN) during a selected time period. When the probability is non-zeroor above a threshold probability, the system may be configured topredict when a hypoglycemic event will occur. The threshold BG_(MIN) maybe a constant or a variable. For convenience, the method will bedescribed by example with respect to the dispenser control system 100 ofFIG. 1.

At 602, the system 100 waits until a beginning of a prediction cycle.For example, the system 100 may be configured to run a prediction cyclewhen new data are available. The system may be configured to run aprediction cycle periodically, such as at 15 minute intervals. Themethod 600 proceeds from 602 to 604.

At 604, the system 100 determines a current blood glucose level, activeinsulin level and the BGL HMM hidden state, BGL_HMM (bg, ai)_(CUR), asdiscussed above for example. The method 600 proceeds from 604 to 606. At606, the system 100 initializes a statistical database to the currentstate. The method 600 proceeds from 606 to 608.

At 608, the system 100 determines a set S of sequences s_(i) of BGLobserved stated BG. Conditions may be imposed on the sequences. Forexample, for each I, s_(i)(1)=bg_(CUR) and s_(i)(last)=bg_(MIN), whereins_(i)(last) is the last element of the sequence s_(i), conditions mayinclude for all j, k where 1≤j≤k≤last, s_(i)(j)≤s_(i)(k), ands_(i)(k)−s_(i)(j)≤the maximum recorded BGL. The sequences s_(i) willhave a finite length, there will be a finite number such sequences, andthe sequences will be reasonable. For example, sequences will not havean element that falls more quickly than previously experienced by apatient. The method 600 proceeds from 608 to 610.

At 610, the system 100 determines a probability for the sequences in theset S that the sequence s_(i) will produce a BGL less than a thresholdBGL. This may be done, for example, by determining a Viterbi probabilityfor each sequence s_(i) in the set S. The method 600 proceeds from 610to 612.

At 612, the system 100 compares the probability for the sequences in theset S to a threshold probability, which may be zero. When the system 100determines that the probability for one or more sequences s_(i) in theset S exceeds the threshold probability, the method 600 proceeds from612 to 614. When the system 100 determines that none of the sequencess_(i) in the set S have a probability exceeding the thresholdprobability, the method 600 proceeds from 612 to 602.

At 614, the system 100 predicts when a hypoglycemic event will occur.This may be done, for example, by selecting the shortest sequence havinga probability exceeding the threshold probability and predicting a timebased on the length of the selected sequence and the length of theprediction cycle or of the data cycle (which may be the same). Forexample, if data are received every 15 minutes and a prediction cycleoccurs in response to the receipt of the data, the length of theselected sequence may be divided by four to predict when an event willoccur in hours. The method 600 proceeds from 614 to 616, where theunsafe BGL is predicted to occur and when may include instructions orsuggestions for avoiding the unsafe BGL. The method 600 proceeds from616 to 602.

Embodiments of the method 600 of FIG. 6 may contain additional acts notshown in FIG. 6, may not contain all of the acts illustrated in FIG. 6,and may combine or separate acts illustrated in FIG. 6. For example, thedispenser control system 100 may be configured to predict hyperglycemicevents in addition to or instead of hypoglycemic events (e.g., predictblood glucose levels above a threshold range, or predict blood glucoselevels above a threshold in combination with a rate of increase in theblood glucose level that is above a threshold rate of increase). Thethreshold levels and ranges discussed with respect to FIG. 6 may befixed or may be functions and may be based on statistical analysis.

FIG. 7 is another high-level hierarchical state diagram 700 illustratinganother example method of controlling a dispenser control system, suchas the dispenser control systems 100, 200, 300 illustrated in FIGS. 1-3.For convenience, the state diagram 700 will be described with referenceto the dispenser control system 100 illustrated in FIG. 1. The dispensercontrol system 100 is initiated at initiation state 702. A user maytypically initiate the dispenser control system 100 just prior toconsumption of a meal or when it is desirable to enter informationregarding an individual.

The dispenser control system 100 transitions 704 from initiation state702 to a safety super-state 706 and enters a wait-for-user-input state708.

While in the safety super-state 706, the dispenser control system 100determines whether data generated or received by dispenser controlsystem 100 indicates that a dangerous condition exists. When thedispenser control system 100 determines in the safety super state 706that a dangerous condition exits, the dispenser control system 100 maybe configured to generate control signals to active an alarm (e.g., avisual alarm, an audio alarm, a vibration alarm, a remote alarm, and/orcombinations of the above), which may vary based on the nature of thedangerous condition and/or the operational state of the dispensercontrol system, and to cause the dispenser control system 100 totransition to the wait-for-user-input state 708. For example, when thedispenser control system 100 determines that an individual is sleepingand that a dangerous condition has arisen, the dispenser control systemmay be configured to sound an alarm loud enough to wake the individual.The dispenser control system 100 may be configured to determine that adangerous condition exists in response to, for example: an indicationthat a monitored blood glucose level is below or above threshold levels;an indication that a predicted blood glucose level will be below orabove threshold levels; an indication of an equipment failure; or anindication of improbable blood glucose levels for an individual (forexample, blood glucose levels inconsistent with an individual's historyor historical glycemic profile, or with data received regarding anindividual, such as an indication of when a meal was consumed or acarbohydrate ratio of a meal).

In the illustrated state diagram 700, the dispenser control system 100also is configured to determine whether a dangerous condition exists bymonitoring the active insulin level in the monitor active insulin (AI)super-state 710, as discussed in more detail below. When the dispensercontrol system 100 determines in the monitor active insulin super state710 that a dangerous condition exits based on the monitoring of theactive insulin level, the dispenser control system 100 may be configuredto generate control signals to active an alarm and to limit insulininfusion, and to transition to the wait-for-user-input state 708.

The threshold levels and ranges may be fixed or may be functions and maybe based on statistical analysis. For example, an indication of a bloodglucose level below a threshold level of 80 mg/dl may cause thedispenser control system 100 to determine that a dangerous conditionexists. In another example, an active insulin level above a thresholdlevel of 20 insulin units may cause the dispenser control system 100 todetermine in the monitor active insulin super state 710 that a dangerouscondition exists. An active insulin level may be determined based on ahistory of doses over a selected time period, with the impact of eachdose adjusted using a form factor indicative of the reduced insulinactivity due to the time elapsed since the dose was given. A thresholdinsulin activity maximum level may be fixed or a function, and may beset using an adjustable input parameter. Similarly, the determination ofwhether a blood glucose level is improbable may be based on thresholds,functions and statistical analysis. Look-up tables, fuzzy logic and/orneural networks may be employed, for example. Indications of equipmentfailure may include direct indications (for example, an error signalfrom the insulin dispenser 104), or indirect indications (for example,inconsistent indications of blood glucose levels from multiple bloodglucose sensors 108 in a blood glucose sensor system 102, or anindication that a pump is not operating properly, such as an indicationan insulin dispenser 104 is not responding to a control signal).

In the state diagram illustrated in FIG. 7, when the dispenser controlsystem 100 determines that a dangerous condition exists, the dispensercontrol system 100 is configured to trigger an alarm (such as an alarmby the user output 164 and/or a remote alarm) and to enter thewait-for-user-input state 708.

The dispenser control system 100 is configured to enter thewait-for-user-input state 708 when the dispenser control system 100 isinitiated, when invoked by the user (for example, when the user wishesto enter information such as information regarding a meal), which may beat the same time as initiation, or in response to a dangerous conditionor an anomaly being detected. In the wait-for-user-input state 708, thedispenser control system 100 is configured to wait for user input. Thedispenser control system 100 may be configured to prompt the user forinput, and may be configured to signal an alarm. For example, when thewait-for-user-input state 708 is entered from the safety super-state 706or the monitor AI super state 710, the dispenser control system 100 maybe configured to signal an alarm. The dispenser control system 100 maybe configured to time-out if no user input is received within athreshold period of time. For example, when the wait-for-user-inputstate 708 is entered from initiation state 702, the dispenser controlsystem 100 may be configured to wait for a threshold period of time forinput from a user, and then transition to another state such as thepost-meal correction state 712 or the insulin dose control state 714 ifcertain conditions are satisfied, as discussed in more detail below. Thedispenser control system 100 may be configured to respond to directcommands to dispense particular amounts of insulin, and may be furtherconfigured to require confirmation, for example, if a commanded dose isinconsistent with an actual or predicted blood glucose level or anactive insulin level.

The user input may include information regarding a meal about to beconsumed, a meal recently consumed, or information about an individual,as discussed above. When the information includes information regardinga meal that is about to be consumed, the dispenser control system 100may be configured to generate control signals to cause the insulindispenser 104 to dispense a bolus dose (or a pre-meal dose) of insulin.The bolus dose may be calculated using known methods using factors thatmay include, for example, insulin sensitivity and a carbohydrate ratio.The dispenser control system 100 may also be configured to generatecontrol signals to cause the insulin dispenser 104 to dispense a basalinsulin dose. Basal insulin doses may be dispensed periodically and awide range of dosing intervals may be employed (e.g., fifteen minutedosing intervals).

The dispenser control system 100 is configured to transition 716 fromthe wait-for-user-input state 708 to the post-meal correction state 712when it is determined that a meal has recently been consumed. Thisdetermination may be made, for example, in response to user inputindicating a meal has been consumed or in response to an indication,such as a blood sugar level history, consistent with a meal beingconsumed. Fuzzy logic, a neural network and/or a look-up table may beemployed, for example, to determine whether a meal has been consumed.

The dispenser control system 100 may be configured to delay thetransition 716. For example, the dispenser control system 100 may beconfigured upon determining that an unreported meal has been consumed,to prompt the user for information about the meal and to wait athreshold period of time before transitioning 716 to the post-mealcorrection state 712. In another example, it may be desired to delaypost-meal correction for a threshold period of time after a meal isconsumed. In such a case, the dispenser control system 100 may beconfigured to wait until a post-prandial delay threshold (e.g. twohours) has been exceeded before transitioning 716 from thewait-for-user-input state 708 to the post-meal correction state 712.

The dispenser control system 100 is configured to transition 718 fromthe wait-for-user-input state 708 to the insulin dose control state 714when threshold conditions are satisfied. The threshold conditions mayinclude, for example, a blood glucose level within an acceptable range,an active insulin level within an acceptable range, and the absence ofan indication that a meal has been consumed within a threshold period oftime. For example, if the history is consistent with a sufficientpost-prandial period, the user has not entered information indicating ameal has been or is about to be consumed, the blood glucose level iswithin a threshold range (e.g., between 90 and 140 mg/dl), the activeinsulin level is below a threshold level (e.g., 20 insulin units), andthe time is consistent with nocturnal operation, the dispenser controlsystem 100 may be configured to transition 718 from thewait-for-user-input state 708 to the insulin dose control state 714(e.g., for nocturnal control of blood glucose level). The dispensercontrol system 100 may be configured to require user input beforetransitioning 718 from the wait-for-user-input state 708 to the insulindose control state 714 (e.g., express confirmation that no meal has beenconsumed for the past several hours and that no meal will be consumedfor the next several hours). Determining whether the user has enteredinformation indicating a meal has been or is about to be consumed mayinclude waiting a threshold period of time for the user to enterinformation, if desired.

As illustrated, the wait-for-user-input state 708 is within the safetysuper state 706. Thus, the dispenser control system 100 may beconfigured not to transition from the wait-for-user input state 708 toanother state if a dangerous condition exists, and when it is determinedthat a dangerous condition has developed while the dispenser controlsystem 100 is in the wait-for-user-input state 708, the dispensercontrol system 100 may be configured to generate control signals toactivate an alarm.

In the post-meal correction state 712, the dispenser control system 100is configured to periodically determine whether an additional bolus doseshould be provided, whether a basal dose should be reduced, or whetherthe conditions are such that the dispenser control system 100 shouldtransition 720 to the insulin dose control state 714. For example, if anacceleration of blood glucose level indicates an insufficient bolus dosewas provided, the dispenser control system 100 may be configured todispense an additional bolus dose 722. In another example, if a rate ofchange of blood glucose level indicates too large a bolus dose wasprovided, the dispenser control system 100 may be configured to reducethe basal dose 724. A minimum basal dose level may be set or determinedbased on information about the individual. In another example, thedispenser control system 100 may be configured to transition 720 to theinsulin dose control state 714 when threshold conditions are satisfied.For example, if the history is consistent with a sufficientpost-prandial period, the blood glucose level is within a thresholdrange (e.g., between 90 and 140 mg/dl), and the active insulin level isbelow a threshold (e.g., 20 insulin units), the dispenser control system100 may be configured to transition 720 from the post-meal correctionstate 712 to the insulin dose control state 714.

As illustrated, the post-meal correction state 712 is within the safetysuper state 706 and the monitor active insulin super state 710. Thedispenser control system 100 may be configured to activate an alarm andtransition 726 from the post-meal correction state 712 to thewait-for-user-input state 708 when it is determined that a dangerouscondition exists. Further, when the determination that a dangerouscondition exists is based in part on a determination that an activeinsulin level exceeds a threshold level, the dispenser control system100 may be configured to limit insulin infusion. For example, thedispenser control system 100 may limit insulin infusion to a thresholdamount for a threshold period of time. The dispenser control system 100also may be configured to transition 728 from the post-meal correctionstate 712 to the wait-for-user-input state 708 in response to commandsreceived by the dispenser control system 100 (e.g., a command entered bya user).

The dispenser control system 100 is configured in the insulin dosecontrol state 714 to monitor blood glucose levels and to periodicallydispense insulin based on the current blood glucose level and thehistory of the monitored blood glucose levels. The dispenser controlsystem 100 may be configured to dispense insulin based on otherinformation about an individual, as discussed above. The dispensercontrol system 100 may employ, for example, fuzzy logic, a neuralnetwork, a look-up table, or software routines to periodically dispenseinsulin based on the history of the monitored blood glucose levels andother information. Table 3 below illustrates an example fuzzy logicDosing Rules Matrix that may be applied by the dispenser control system100 to control the dispensing of insulin while in the insulin dosecontrol state. The dosing identifiers in Table 3 representexperimentally distinct doses of insulin, which may be measured in Unitsof Insulin. The dosing identifiers from largest dose to smallest doseare VVL (very very large), VL (very large), LRH (large high), LR(large), LRL (large low), MDH (medium high), MD (medium), MDL (mediumlow), SMH (small high), SM (small), SML (small low) and VSM (verysmall). The first fuzzy input is the current blood glucose level BGL inmg/dl units, represented in the bottom four rows with fuzzy coverings VH(very high), HI (high), MD (medium), and NR (normal). The second fuzzyinput is the rate of change of the blood glucose level, represented inrow BGL RATE with fuzzy coverings N (negative), Z (zero), P (positive)and very positive. The third fuzzy variable is acceleration of the bloodglucose level, represented in row BGL Acceleration with fuzzy coveringsN (negative), Z (zero) and P (positive). Example trajectoriescorresponding to the blood glucose level rate of change and accelerationare illustrated in row BGL Trajectory. The fuzzy coverings may beexperimentally determined, and may vary based on additional factors suchas the method of delivering a dose of insulin.

TABLE 3 EXAMPLE DOSING RULES MATRIX BGL Rate: N Z P VP BGL Acceleration:N Z P N Z P N Z P N Z P BGL Trajectory:

BGL VH LRL LR LRH LRH LRH VL VL VL VL VVL VVL VVL HI SM SMH MDH SMH MDLLRL MDH VL VL MDH VVL VVL MD SML SM SMH SM SMH MDL SMH MDH MDH SMH VVLVVL NR VSM VSM VSM VSM SML SM SML SM SMH SML SM SMH

The dispenser control system 100 is configured to transition 730 fromthe insulin dose control state 714 to the post-meal correction state 712when the dispenser control system 100 determines that a meal has beenconsumed and that the size of the meal is such that additional userinput regarding the meal is not necessary. For example, the dispensercontrol system 100 may be configured to transition 730 from the insulindose control state 714 to the post-meal correction state 712 when acurrent indication of a blood glucose level is within a threshold level(e.g., between 160 mg/dl and 200 mg/dl) and the increase in the currentindication of a blood glucose level from the previous indication of ablood glucose level exceeds a threshold level (e.g., the indication of ablood glucose level jumped by more than 10 mg/dl since the lastmeasurement was received). The dispenser control system 100 may beconfigured to transition 732 from the insulin dose control state 714 tothe wait-for-user input state 708 when the dispenser control system 100determines that a large meal has been consumed and that it is desirableand/or necessary to obtain user input. For example, the dispensercontrol system 100 may be configured to transition 732 from the insulindose control state 714 to the wait-for-user input state 708 when acurrent indication of a blood glucose level is above a threshold level(e.g., above 200 mg/dl) and the increase in the current indication of ablood glucose level from the previous indication of a blood glucoselevel exceeds a threshold level (e.g., the indication of a blood glucoselevel jumped by more than 10 mg/dl since the last measurement wasreceived).

As illustrated, the insulin dose control state 714 is within the safetysuper state 706 and the monitor active insulin super state 710. Thedispenser control system 100 is configured to activate an alarm andtransition 734 from the insulin dose control state 714 to thewait-for-user-input state 708 when it is determined that a dangerouscondition exists. Further, when the determination that a dangerouscondition exists is based in part on a determination that an activeinsulin level exceeds a threshold level, the dispenser control system100 may be configured to limit insulin infusion. For example, thedispenser control system 100 may limit insulin infusion to a thresholdamount for a threshold period of time. The dispenser control system 100also may be configured to transition 736 from the insulin dose controlstate 714 to the wait-for-user-input state 708 in response to commandsreceived by the dispenser control system 100 (e.g., a command entered bya user, for example, an indication that a meal is about to be consumed).

Embodiments of the method of operation a dispenser control systemillustrated by the hierarchical state diagram 700 of FIG. 7 may notcontain all of the illustrated states, superstates and transitions, maycontain additional states, superstates and transitions, or may combineor separate illustrated states and superstates. For example, thepost-meal correction state 712 and the insulin dose control state 714may be combined into an automatic dose control state in someembodiments. The threshold levels and ranges discussed with respect toFIG. 7 may be fixed or may be functions and may be based on statisticalanalysis. The embodiment of FIG. 7 may also be modified to transition tothe wait-for-user-input state and to sound an alarm upon an indicationpredictive of a dangerous condition.

FIG. 8 is a high-level state diagram 800 illustrating another examplemethod of operating a system, such as the dispenser control systems 100,200, 300 illustrated in FIGS. 1-3. For convenience, the state diagramwill be described with reference to the dispenser control system 100illustrated in FIG. 1.

The dispenser control system 100 is powered on at state 802. Thedispenser control system 100 enters a user-input state or mode 804. Inthe user-input state 804, the dispenser control system 100 waits foruser input (e.g., for a threshold period of time), and based on anyreceived user input and/or data received or previously stored by thedispenser control system 100, may transition to one of three states ormodes of operation. User-input may also be received in other states ormodes of operation, for example, as discussed in more detail below.

When the dispenser control system 100 is in the user-input state 804 andreceives information indicating a meal has been or is about to beconsumed (e.g., user input or received data indicating a meal has beenconsumed) and user input indicative of a carbohydrate content for themeal, the dispenser control system 100 is configured to transition 806from the user-input state 804 to a compliant state or mode 808. Thecompliant state 808 is entered because the user has complied with arequest to supply information indicative of the carbohydrate content ofthe meal that is about to be, or has recently been, consumed. In someembodiments, the indication that a meal has been or is about to beconsumed may be determined solely based on user input. In someembodiments, the system may prompt the user for carbohydrate informationand, depending on whether information is provided in response to theprompt, transition to either the compliant 808 or semi-compliant 812state.

When the dispenser control system 100 is in the user-input state 804 andreceives information indicating a meal is about to be or has beenrecently consumed, but does not receive information indicative of acarbohydrate content for the meal, the dispenser control system 100transitions 810 from the user-input state 804 to a semi-compliant state812. The semi-compliant state 812 is entered because the dispensercontrol system 100 has determined that a meal was recently, or is aboutto be, consumed, but has not been provided with an indication of thecarbohydrate content of the meal. In some embodiments, the indicationthat a meal has been or is about to be consumed may be determined solelybased on user input.

When the dispenser control system 100 is in the user-input state 804,and determines that it is appropriate to operate in a fasting state ormode 814, the dispenser control system 100 is configured to transition816 from the user-input state 804 to the fasting state 814. For example,the dispenser control system 100 may determine it is appropriate totransition 816 from the user-input state 804 to the fasting state 814when there is no indication that a meal is about to be or has beenrecently consumed, and an indication of a blood glucose level is withina threshold range (e.g., between 90 and 140 mg/dl). In another example,the dispenser control system may also determine it is appropriate totransition 816 from the user-input state 804 to the fasting state 814when the user inputs data indicating the user is fasting, and anindication of a blood glucose level or history is consistent with thisinput (e.g., the blood glucose level is within a threshold range).

In the compliant mode 808, the dispenser control system 100 sets apost-prandial blood glucose level target and may generate controlsignals to dispense insulin doses based on the target post-prandialblood glucose level, the information regarding the carbohydrate contentof the meal, stored and received data regarding the individual consumingthe meal, and/or current and historical indications of the blood glucoselevel of the individual. For example, the dispenser control system 100may dispense and adjust bolus and basal insulin doses (see, for example,the discussion above with respect to the post-meal correction state 712of FIG. 7).

The dispenser control system 100 is configured to transition 818 fromthe compliant state 808 to the fasting state 814 when a fasting criteriais satisfied. For example, the dispensing control system 100 may beconfigured to transition 818 from the compliant state 808 to the fastingstate 814 when a threshold amount of time has passed since the dispensercontrol system 100 entered the compliant state 808 (e.g., three hours)and the blood glucose level is within a threshold range (e.g., 90 to 140mg/dl). Other criteria may be imposed. For example, a rate of change ofthe blood glucose level may need to be within a threshold range for thefasting criteria to be satisfied.

In the semi-compliant mode 812, the dispenser control system 100 sets apost-prandial blood glucose level target and may generate controlsignals to dispense insulin doses based on the target post-prandialblood glucose level, stored and received data regarding the individualconsuming the meal (which may include indications of historicalcarbohydrate levels), and/or current and historical indications of theblood glucose level of the individual. For example, the dispensercontrol system 100 may dispense and adjust bolus and basal insulin doses(see, for example, the discussion above with respect to the post-mealcorrection state 712 of FIG. 7).

The dispenser control system 100 is configured to transition 820 fromthe semi-compliant state 812 to the fasting state 814 when a fastingcriteria is satisfied. For example, the dispensing control system 100may be configured to transition 820 from the semi-compliant state 812 tothe fasting state 814 when a threshold amount of time has passed sincethe dispenser control system 100 entered the semi-compliant state 812(e.g., three hours) and the blood glucose level is within a thresholdrange (e.g., 90 to 140 mg/dl). Other criteria may be imposed. Forexample, a rate of change of the blood glucose level may need to bewithin a threshold range for the fasting criteria to be satisfied.

The dispenser control system 100 is configured in the fasting state 814to monitor blood glucose levels and to periodically dispense insulinbased on the current blood glucose level and the history of themonitored blood glucose levels. For example, the dispenser controlsystem 100 may selectively generate one or more control signals to causethe insulin dispenser 104 to dispense one or more doses of insulin tomaintain a desired fasting blood glucose level. The number, size andtiming of the doses may be determined based on any number of criteria,including, for example, information stored by the dispenser controlsystem 100 or entered through the user input device 162 regardingpatient weight or body-mass index, sensed current and historical bloodglucose levels, including past post-prandial blood glucose histories forthe patient, indications of insulin sensitivity for the patient, andother information pertinent to maintaining a target fasting bloodglucose level. The dispenser control system 100 may employ, for example,fuzzy logic, a neural network, a look-up table, software routines, orcombinations thereof to periodically dispense insulin based on thehistory of the monitored blood glucose levels. For example, the fuzzylogic rules illustrated in the matrix of Table 1 may be applied.

When the dispenser control system 100 is operating in the fasting state814 and receives information (e.g., indications of a change in bloodglucose level consistent with eating a meal) or user input is receivedthat provides an indication that a meal has been or is about to beconsumed and an indication of a carbohydrate content for the meal, thedispenser control system 100 transitions 822 to the compliant state 808.When the dispenser control system 100 is in the fasting state andreceives information (e.g., indications of a change in blood glucoselevel consistent with eating a meal) or user input is received thatindicates a meal has been or is about to be consumed, but no orinsufficient information is received regarding a carbohydrate contentfor the meal, the dispenser control system 100 transitions 824 to thesemi-compliant state 812.

Embodiments of the state diagram illustrated in FIG. 8 may containadditional states not shown in FIG. 8, may not contain all of the statesillustrated in FIG. 8, may contain additional transitions notillustrated in FIG. 8, may not contain all of the transitionsillustrated in FIG. 8, and may combine or separate states illustrated inFIG. 8. For example, the dispenser control system 100 may be configuredto set an alarm and transition to the user-input state whenever an erroris detected, such as an equipment malfunction, or if unsafe bloodglucose levels are detected or predicted (e.g., blood glucose levelsoutside a threshold range, or blood glucose levels above a threshold incombination with a rate of increase in the blood glucose level that isabove a threshold rate of increase). In another example, the compliantand semi-compliant modes may be combined in some embodiments. Thethreshold levels and ranges discussed with respect to FIG. 8 may befixed or may be functions and may be based on statistical analysis.

FIGS. 9A through 9C illustrate a mid-level flow diagram of an anotherexample embodiment of a method 900 that may be employed by a system,such as the dispenser control systems 100, 200 and 300 illustrated inFIGS. 1 through 3, to control the dispensing of insulin. Forconvenience, the method will be described with respect to the embodimentof a dispenser control system 100 illustrated in FIG. 1.

The dispenser control system 100 initializes the method 900 at 902. Themethod 900 proceeds from 902 to 904. At 904, the dispenser controlsystem 100 requests user input and optionally provides information tothe user. For example, when the method 900 has proceeded to 904 inresponse to an initialization, the dispenser control system 100 may beconfigured to request data input regarding the individual for whom thedispenser control system 100 is to control the blood glucose level, suchas, for example, input identifying an individual which can be associatedwith previously stored information. In another example, the dispensercontrol system 100 may be configured to request user-input related towhether a meal is about to be or has recently been consumed, and if so,information related to the meal, such as information related to acarbohydrate content of the meal. In another example, when the methodhas proceeded to 904 in response to the detection of a dangerouscondition, the dispenser control system 100 may be configured to alertthe user to the dangerous condition and to request user-input related toa response to the dangerous condition. For example, the dispensercontrol system 100 may be configured to request information related to abolus dose if the dangerous condition detected is an indication that alarge meal was consumed. The dispenser control system 100 may, forexample, be configured to set flags to facilitate requesting appropriateuser-input for use in determining an appropriate response to a dangerouscondition. In some embodiments, when the method has proceeded to 904 inresponse to the detection of a dangerously low blood glucose level, thedispenser control system 100 may be configured to alert the user to thedangerous condition, to suggest that the user take appropriate action,such as consuming a meal containing a particular range of carbohydrates,and to request that the user confirm consumption of the meal and enterinformation related to the carbohydrate content of the meal.

The method 900 proceeds from 904 to 906. At 906, the dispenser controlsystem 100 waits for user input. The dispenser control system 100 may beconfigured to wait for user input for a threshold period of time, or towait until user input is received, or combinations of the above. Forexample, the dispenser control system 100 may be configured to wait forinformation related to the identity of an individual, and afterinformation identify the individual is received, to wait a thresholdperiod of time to give the user an opportunity to enter informationrelated to a meal. The threshold period of time may vary. For example,different threshold periods of time may be employed depending on whethera dangerous condition flag is set. The method 900 proceeds from 906 to908.

At 908, the dispenser control system 100 determines whether there is anindication of a prandial event. The dispenser control system 100 may beconfigured to determine whether there is an indication of a prandialevent in response to user input, data received, for example, from theblood glucose sensor system 102, historical data received by the bloodglucose sensor system 102, data previously entered by the user, orcombinations of the above. For example, the user may enter dataindicating a prandial event is about to occur, with or without anindication of a carbohydrate content of the meal. In another example,the dispenser control system 100 may determine based on indications ofblood glucose levels received from the blood glucose sensor system 102that a prandial event has occurred. When the dispenser control system100 determines that there is an indication of a prandial event, themethod 900 proceeds from 908 to 910. When the dispenser control system100 determines that there is not an indication of a prandial event, themethod 900 proceeds from 908 to 926. In some embodiments, when thedispenser control system 100 determines that there is not an indicationof a prandial event, the method 900 proceeds from 908 to 936.

At 910, the dispenser control system 100 generates control signals tocontrol the dispensing of insulin in response to the prandial eventbased on any received user input and/or other data. For example, thedispenser control system 100 may dispense an initial bolus dose. In someembodiments, an indication of the blood glucose level may be checkedperiodically (e.g., every 30 minutes) to determine whether to requestadditional input data from the user. For example, in some embodiments ifthe blood glucose level exceeds a threshold amount after 30 minutes(e.g., 200 mg/dl), the user may be asked whether an additional bolusdose should be administered. The method proceeds from 910 to 912.

At 912, the dispenser control system 100 determines whether thesufficient time has elapsed since the prandial event. The dispensercontrol system 100 may determine whether sufficient time has elapsed by,for example, comparing the elapsed time to a threshold (e.g., twohours). The dispenser control system 100 may employ, for example,look-up tables, neural networks, and/or fuzzy logic to determine whethera sufficient amount of time has elapsed since the prandial event. Whenthe dispenser control system 100 determines that a sufficient amount oftime has elapsed since the prandial event, the method 900 proceeds from912 to 914. When the dispenser control system 100 determines that asufficient amount of time has not elapsed since the prandial event, themethod 900 proceeds from 912 to 910.

At 914, the dispenser control system 100 determines whether additionaldata from the user is desirable for use in making a bolus correction.For example, the dispenser control system 100 may determine thatadditional data is desirable if the blood glucose level is above athreshold level (e.g., 200 mg/dl) and the increase since a last bloodglucose level is above a threshold (e.g., the blood glucose level hasincreased by more than 10 mg/dl since the last reading). The dispensercontrol system 100 may employ, for example, neural networks, look-uptables and/or fuzzy logic to determine whether additional data from theuser is desirable.

When the dispenser control system 100 determines at 914 that additionaldata from the user is desirable, the method 900 proceeds from 914 to916. At 916, the dispenser control system 100 signals the user that theblood glucose level is too high. The dispenser control system 100 mayalso be configured to set an indication of a new prandial event (e.g.,the dispenser control system 100 may reset a counter tracking the timesince the last prandial event.) The method 900 proceeds from 916 to 917.At 917, the dispenser control system 100 requests and waits for userinput for use by the dispenser control system 100 in determining anappropriate bolus correction. The method 900 proceeds from 917 to 918.At 918, the dispenser control system 100 determines a bolus dose andgenerates control signals to cause the insulin dispenser to dispense thebolus dose. The size of the bolus correction insulin dose may bedetermined, for example, based user input, received data, stored data,the size and number of prior bolus doses, or combinations of the above.The dispenser control system 100 may employ, for example, neuralnetworks, look-up tables and/or fuzzy logic to determine the size of thebolus dose. The method 900 proceeds from 918 to 919. At 919, thedispenser control system 100 waits a threshold period of time (e.g.,thirty minutes) for the insulin in the bolus dose to work in theindividual. After the threshold period of time has elapsed, the method900 proceeds from 919 to 910.

When the dispenser control system 100 determines at 914 that requestingadditional data from the user is not necessary or desirable, the method900 proceeds from 914 to 920. At 920, the dispenser control system 100determines whether insulin delivery should be suspended. For example,the dispenser control system 100 may determine that insulin deliveryshould be suspended when a current indication of a blood glucose levelis below a threshold level (e.g., 80 mg/dl). The dispenser controlsystem 100 may employ, for example, neural networks, look-up tablesand/or fuzzy logic to determine whether insulin delivery should besuspended.

When the dispenser control system 100 determines at 920 that insulindelivery should be suspended, the method 900 proceeds from 920 to 922.At 922, the dispenser control system 100 signals the user that the bloodglucose level is too low, and may be configured to suggest correctiveaction, such as the consumption of a small meal. The method 900 proceedsfrom 922 to 924. At 924, the dispenser control system suspends deliveryof insulin. The method 900 proceeds from 924 to 914.

When the dispenser control system 100 determines at 920 that insulindelivery should not be suspended, the method 900 proceeds from 920 to926. At 926, the dispenser control system 100 determines whetheradditional user input for use in making a bolus correction is desirable.For example, the dispenser control system 100 may determine thatadditional data is desirable if the blood glucose level is above athreshold level (e.g., 200 mg/dl) and the increase since a last bloodglucose level is above a threshold (e.g., the blood glucose level hasincreased by more than 10 mg/dl since the last reading). The dispensercontrol system 100 may employ, for example, neural networks, look-uptables and/or fuzzy logic to determine whether additional data from theuser is desirable. When the dispenser control system 100 determines at926 that additional user input is desirable, the method 900 proceedsfrom 926 to 916. When the dispenser control system 100 determines at 926that additional user input is not necessary, the method 900 proceedsfrom 926 to 928.

At 928, the dispenser control system 100 determines whether toadminister an automatic bolus correction dose. For example, thedispenser control system 100 may determine to administer an automaticbolus correction dose if an indication of a current blood glucose levelis within a threshold range (e.g., between 140 mg/dl and 200 mg/dl) andthe change in the indication of a blood glucose level over a period oftime exceeds a threshold (e.g., the blood glucose level has increased bymore than 10 mg/dl over the proceeding fifteen minutes). The dispensercontrol system 100 may employ, for example, neural networks, look-uptables and/or fuzzy logic to determine whether to administer anautomatic bolus correction dose.

When the dispenser control system 100 determines at 928 to administer anautomatic bolus correction dose, the method 900 proceeds from 928 to930. At 930, the dispenser control system 100 generates control signalto cause the insulin dispenser 104 to dispense a bolus correctioninsulin dose. The size of the bolus correction insulin dose may bedetermined based user input, received data, stored data, the size andnumber of prior bolus doses, or combinations of the above. For example,if no prior automatic bolus correction doses have been administeredsince the last prandial event, the dispenser control system 100 maygenerate control signals to cause the insulin dispenser 104 toadminister a bolus dose equivalent to a default bolus dose. If theautomatic bolus correction dose is a second automatic bolus correctiondose since the last prandial event, the dispenser control system 100 maygenerate control signals to cause the insulin dispenser 104 toadminister a bolus dose equivalent to, for example, eighty-percent of adefault bolus dose. If the automatic bolus correction dose is a thirdautomatic bolus correction dose since the last prandial event, thedispenser control system 100 may generate control signals to cause theinsulin dispenser 104 to administer a bolus dose equivalent to, forexample, sixty-percent of a default bolus dose. The dispenser controlsystem 100 may employ, for example, neural networks, look-up tablesand/or fuzzy logic to determine the size of an automatic boluscorrection dose.

The method 900 proceeds from 930 to 932. At 932, the dispenser controlsystem waits a threshold period of time (e.g., thirty minutes) for theinsulin in the bolus dose to work in the individual. After the thresholdperiod of time has elapsed, the method 900 proceeds from 932 to 926.

When the dispenser control system 100 determines at 928 not toadminister an automatic bolus correction dose, the method 900 proceedsfrom 928 to 934. At 934, the dispenser control system 100 determineswhether to suspend the dispensing of insulin. For example, the dispensercontrol system 100 may determine that insulin delivery should besuspended when a current indication of a blood glucose level is below athreshold level (e.g., 80 mg/dl). The dispenser control system 100 mayemploy, for example, neural networks, look-up tables and/or fuzzy logicto determine whether a blood glucose level is too low.

When the dispenser control system 100 determines at 934 that insulindelivery should be suspended, the method 900 proceeds from 934 to 922.When the dispenser control system 100 determines at 934 that insulindelivery should not be suspended, the method 900 proceeds from 934 to936.

At 936, the dispensing control system 100 retrieves current andhistorical blood glucose level data. The method 900 proceeds from 936 to938. At 938, the dispensing control system 100 calculates the rate ofincrease in the blood glucose level and the acceleration of the rate ofincrease in the blood glucose level. The method 900 proceeds from 938 to940.

At 940, the dispensing control system 100 determines whether there is anindication that a meal has been eaten. The dispensing control system 100may, for example, determine that there is an indication that a meal hasbeen consumed based on user input, based upon current and historicalindications of blood glucose levels, and/or combinations of the above.When the dispensing control system 100 determines at 940 that there isan indication that a meal has been consumed, the method 900 proceedsfrom 940 to 904. When the dispensing control system determines at 940that there is no indication that a meal has been eaten, the method 900proceeds from 940 to 942.

At 942, the dispensing control system 100 determines whether adangerously high blood glucose condition exists. The dispensing controlsystem 100 may, for example, determine that a dangerously high bloodglucose condition exists if an indication of a current blood glucoselevel exceeds a threshold amount (e.g., 200 mg/dl) and a rate of changeof the blood glucose level exceeds a threshold rate of change (e.g., anincrease of 10 mg/dl over fifteen minutes). When the dispensing controlsystem 100 determines that a dangerously high blood glucose conditionexists, the method 900 proceeds from 942 to 944. At 944, the dispensingcontrol system 100 sets appropriate warning flags or generatesappropriate control signals. For example, the dispensing control system100 may set a flag to cause the output device to sound an alarm. Themethod 900 proceeds from 944 to 904. When the dispensing control system100 determines that a dangerously high blood glucose condition does notexist, the method 900 proceeds from 942 to 946.

At 946, the dispensing control system 100 determines whether post-mealcorrection is desirable. The dispensing control system 100 may, forexample, determine that post-meal correction is desirable if anindication of a current blood glucose level exceeds a threshold amount(e.g., 160 mg/dl) and a rate of change of the blood glucose levelexceeds a threshold rate of change (e.g., an increase of 10 mg/dl overfifteen minutes). When the dispensing control system 100 determines thatpost-meal correction is desirable, the method 900 proceeds from 946 to926. When the dispensing control system 100 determines that post-mealcorrection is not necessary, the method 900 proceeds from 946 to 948.

At 948, the dispensing control system 100 fuzzifies the blood glucoselevel, the blood glucose rate and the blood glucose acceleration. Thismay be done, for example, by assigning the fuzzy coverings of Table Oneto ranges of blood glucose levels, blood glucose rates of increase, andblood glucose rates of acceleration. The method 900 proceeds from 948 to950.

At 950, the dispensing control system 100 applies fuzzy logic rules todetermine a fuzzy insulin control dose. For example, the dispensingcontrol system 100 may apply the fuzzy logic rules illustrated in TableOne. The method 900 proceeds from 950 to 952. At 952, the dispensingcontrol system 100 determines the insulin dose by defuzzifying the fuzzyinsulin control dose. The method proceeds to 954. At 954, the dispensingcontrol system 100 optionally adjusts the insulin control dose based onpersonal information regarding the individual. For example, it may bedesirable to adjust the dosage based on the weight of an individual. Themethod 900 proceeds from 954 to 956. At 956, the dispensing controlsystem 100 displays the recent blood glucose history and the adjustedinsulin control dose, and may wait a threshold period of time to allowthe user to intervene. The method 900 proceeds from 956 to 958. At 958,the dispensing control system 100 generates control signals to cause theinsulin dispenser 104 to dispense the adjusted insulin control dose. Themethod 900 proceeds from 958 to 934.

Embodiments of the method illustrated in FIGS. 9A through 9C may containadditional acts not shown in FIGS. 9A through 9C, may not contain all ofthe acts shown in FIGS. 9A through 9C, may perform acts shown in FIGS.9A through 9C in various orders, and may combine acts shown in FIGS. 9Cthrough 9C. For example, the method 900 may be modified to perform act912 after act 920. In another example, the method 900 may be modified tomonitor active insulin levels and to suspend dispensing of insulin whenan active insulin level exceeds a threshold level. In another example,the method 900 may be modified to employ, for example, a look-up tableor a neural network to determine the adjusted insulin control dose, inaddition to, or instead of, employing fuzzy logic rules. In anotherexample, the method 900 may be modified to combine acts 914 and 926. Inanother example, the method 900 may be modified to proceed from act 924to act 904. In another example, the method 900 may be modified toproceed from act 940 to act 926 when it is determined that a meal hasbeen consumed. In another example, the fuzzy logic rules may be adjustedto incorporate patient-specific information, such as weight variations.

FIG. 10 is a functional block diagram of an embodiment of system 1000for predicting and/or controlling blood glucose levels. The system 1000comprises a processor 1002 and a memory 1004, a data input subsystem1006, a blood glucose level predictor 1008, an output subsystem 1010 anda bus system 1012. FIG. 11 is a functional block diagram of system 1000for predicting and/or controlling blood glucose levels wherein thesystem 1000 further comprises a parameter and model adjuster 1009. Insome embodiments, discrete circuitry and/or one or more proportional andintegral controllers may be employed instead of, or in addition to, theillustrated processor 1002, memory 1004, data input subsystem 1006,blood glucose level predictor 1008, parameter and model adjuster 1009and output subsystem 1010. As described in more detail below, the system1000 predicts blood glucose levels based on historical data.

Embodiments of a system and method for predicting blood glucose levelsmay be stand-alone, or may be incorporated into other systems andmethods, such as those described herein. For example, the blood glucoselevel predictor 1008 may be incorporated into the data system 120 ofFIG. 1. In another example, the blood glucose level predictor 1008 maybe incorporated into the blood glucose analyzer 166 of FIG. 1. Inanother example, the blood glucose level predictor 1008 may beincorporated into the control system 140 of FIG. 1. In some embodiments,the predictions may be used to control the dispensing of insulin. Insome embodiments, the predictions may be compared to results and modelsand/or parameters used in the predictions may be adjusted based on thecomparison.

FIG. 12 illustrates an embodiment of a method 1200 of predicting bloodglucose levels. The 15-minute sample time, and the 1-hour futureprediction times are examples only. The method may employ arbitraryfixed and non-fixed blood sugar sample times and may predict arbitrarilyfar into the future. As illustrated, a blood sugar (bg) state dependsupon the previous 12 sampled bg states 1202 (3 hours at 15 minute sampletime) and the last calculated active insulin state (ai) state. Themethod predicts the next four bg states 1204, or the states for the nexthour.

As a standalone system the Blood Glucose Prediction method could be usedto prevent episodes of hypo- and hyper-glycemia by alerting the patientearly enough so that they can manually adjust the insulin themselves. Inthis implementation, the Blood Glucose Prediction system could beresident on an automated blood sugar sensor device or an insulininfusion pump, for example. More generally, as a component of anintegrated system, the Blood Glucose Prediction method could be residenton a system that included an insulin infusion pump and a blood glucosesensor. In this implementation, the Blood Glucose Prediction methodcould predict blood sugar as above and also automatically adjust theinsulin pump dosing to maintain safe blood sugar levels. In this contextthe Blood Glucose Prediction system may be a closed-loop, adaptive BloodGlucose Management system. The system could be used, for example, whereinsulin is infused subcutaneously or intravenously.

In one embodiment, the system provides a novel way to model the behaviorof the pancreas with regard to the secretion of insulin. Typicallyresearchers attempt to model insulin and blood sugar behaviors in termsof differential equations. While differential equations produce goodresults in simulations, they do a poor job at representing real humanmetabolic behavior.

In one embodiment, the system and method inputs are blood sugar levelsand insulin doses, for example, coming from continuous blood glucosemonitors (CGM) and insulin infusion pumps respectively. Carbohydrateestimates are not required, but may be utilized in some embodiments. Thesystem and method can be personalized for a patient by initializing theset of blood sugar and active insulin Feature Patterns to conform tothat patient.

In one embodiment, the system and method adapts in real-time to theindividual patient. Whenever a new actual blood sugar value is read,that value is compared with the previous predicted value to update theparameters of the model so as to make better future predictions.Similarly the coefficients of the Active Insulin polynomial function maybe updated in real-time.

In one embodiment, transition probabilities can be incorporated into thesystem and method. Such probabilities may be generated, for example, byincorporating medical opinions and/or other information regarding thetransition probabilities into the Feature Patterns to further enhancesystem performance. For example, it may be physiologically impossible totransition from some Feature Patterns to others. Initializing thosetransition probabilities to zero may increase the accuracy of theprediction system.

In some embodiments, system performance can be further improved by theincorporation of more accurate Feature Patterns, without changing thebasic prediction mathematics. Straight-line patterns may be used for aninitial set.

FIG. 13 illustrates an embodiment of a system and method of operating asystem 1300, such as the dispenser control systems 100, 200, 300illustrated in FIGS. 1-3, to control the dispensing of insulin. A BGLsensor 1302 is configured to sense one or more indications of a bloodglucose level of a patient 1308, which may be done using direct orindirect measurement of blood glucose levels. The sensor 1302 is coupledto a blood glucose controller 1304. The blood glucose controller 1304also is coupled to a data structure 1306. The blood glucose controller1304 is configured to selectively update the data structure 1306 basedon indications received from the sensor 1302 and to selectively generatecontrol signals to cause an infusion pump 1310 to dispense insulin andan alert device 1312 to signal an alert.

An example embodiment of a system and method of predicting blood glucoselevels is described below.

The variables employed by the example are:

-   -   time. Time is discrete at some interval (e.g., 15 minutes) and        is represented by the time variable t, which can be an integer,        representing an appropriate time interval. For example, t+1 may        be 15 minutes (or any desired interval) later than time t. In        the discussion below, the time interval is assumed to be 15        minutes. In other examples, different and/or non-fixed time        intervals could be employed. For example, one-hour projection        time frames and eight-hour histories are assumed in the        discussion below. Other projection time frames and histories        could be employed. Variable length projection time frames and        histories could be employed. The time periods employed may be        adjustable and may be set, for example, by adjusting model        parameters. Selection of and changes to the selected time        periods may be automated.    -   Insulin dose, at time t, represented by variable d_(t). The        variable d_(t) is a real number (between 0 and 30). This range        is represented by D_(d). Also, d_(t)={d_(t), d_(t-1), . . . ,        d_(t-32)} is the set of previous 8 hours of insulin doses (at 15        minute intervals).    -   Active Insulin (AI), a variable available at time t. This        example uses a_(t) to represent active insulin. In this example,        active insulin represents the cumulated effect of a patient's        insulin doses during previous 8 hours, and can be determined by        the formula:

$a_{t} = {\sum\limits_{\tau = 0}^{32}\; {d_{t - \tau}f_{\tau}}}$

where d_(t) is the insulin dose at time t, and ƒ_(τ) is the attenuationfactor for a dose r time steps into the past. The factor ƒ_(τ) may bespecified by a 6th-order polynomial in τ given constants c₀, . . . , c₆which can be tailored for a current patient using, for example, an arraylookup table. This example assumes that f₀=1 and f_(τ)=0 for τ>32. For0<τ≤32, this example assumes that f_(τ) is given by the followingpolynomial:

$f_{\tau} = {\sum\limits_{j}^{\;}\; {c_{j}\tau^{j}}}$

where {c_(j)}_(j) are the coefficients of a 6th-degree polynomial givenby:

-   -   c₀=0.9998,    -   c₁=0.045    -   c₂=−0.184,    -   c₃=0.0485,    -   c₄=−0.005172,    -   c₅=0.0002243,    -   c₆=−0.00000215.

In this example, AI is a real number between 0 and 50, represented bythe range D_(a). In another embodiment, AI could be quantized to integervalues, for example, 500 values representing numbers between 0.0 and50.0.

Also, a_(t)={a_(t), a_(t-1), . . . , a_(t-32)} is the set of previous 8hours of active insulin levels.

-   -   blood glucose level (BGL), at time t represented by the variable        b_(t). In this example, this variable is measured at each time        step.

Also, b_(t)={b_(t), b_(t-1), . . . , b_(t-32)} is the set of previous 8hours of blood glucose levels.

In this example, BGL is an integer between 30 and 999 (although withthis many integer values, it may be useful to represent this as acontinuous variable in other embodiments). The domain of (set ofpossible values for) b_(t) is represented by D_(b). BGL values may beviewed as representing a range. For example, a value of 80 may representa range of values and a value of 300 another range of values. When BGLvalues are viewed as representing a range, it may be viewed as havingfewer values. For example, it may be viewed as having 30 values if 30ranges are represented.

Embodiments can predict b_(τ) for τ>t, i.e., predict future values ofblood glucose levels. This example assumes that for all times up to andincluding t, the true blood glucose levels are known. In the discussionbelow, b_(t) is the blood glucose level at time t, and {circumflex over(b)}_(t) is the previously predicted blood glucose level at time t. Insome embodiments, b_(t)−{circumflex over (b)}_(t) could be used as acorrector for the model.

In some embodiments, online adaptation may be employed. For example,whenever a new actual value of b_(t) comes in, that actual value and theprevious predicted value {circumflex over (b)}_(t) could be used toupdate the parameters of the prediction system and method, so as to makebetter future predictions. For ease of description, some of the systemsand methods are described with reference to a non-adaptive case, butcould be generalized to the online adaptive case.

Embodiments of the system and method may employ a statistical model(such as an HMM or some variant) that is good at predicting the futurevalues of BGL given information up to and including time t. Note thatthe information up to time t may include the actual values of the BGLarray b_(t), the active insulin array a_(t), and the previous dose arrayd_(t). Some embodiments may include a previous predicted blood glucoselevel {circumflex over (b)}_(t) or an array of previously predictedblood glucose levels. In this example, four future blood glucose levelswill be predicted at 15 minute intervals. A probability model will beproduced, specifically a model that gives p(b_(τ)|b_(t), a_(t), d_(t))for τ>t. For a 15-minute interval and a one-hour prediction window,b_(τ) will be estimated for

τϵ{t+1,t+2,t+3,t+4}.

An embodiment is not required to use all of this information forconditioning. For example, the insulin dose information could be droppedto produce a model p(b_(τ)|b_(t), a_(t)) that depends on BGL and AI ifdesired. In some embodiments, additional information may be used forconditioning. For example, the previously predicted blood glucose levelmay be added to produce a model p(b_(τ)|b_(t), a_(t), d_(t), b_(t)).Additional information may be used in some embodiments to, for example,increase the accuracy of the predictions and/or selected dosing levels.Less information may be employed in some embodiments to, for example,decrease computation time and/or processing requirements, such ashardware requirements.

For example, a most likely BGL at time τ may be predicted according to:

$b_{\tau}^{*} = {\underset{b_{t} \in D_{b}}{\arg \; \max}\mspace{14mu} {p\left( {\left. b_{\tau} \middle| b_{t} \right.,a_{t},d_{t}} \right)}}$

The above approach treats the prediction as a classification problem andpredicts a most probable value.

Alternatively, an expected value (i.e., average predicted) BGL at time τmay be predicted according to:

${\overset{\_}{b}}_{\tau} = {{E\left\lbrack {\left. b_{\tau} \middle| b_{t} \right.,a_{t},d_{t}} \right\rbrack} = {\sum\limits_{b_{\tau}}\; {b_{\tau}{p\left( {\left. b_{\tau} \middle| b_{t} \right.,{a_{t}d_{t}}} \right)}}}}$

This alternative treats the prediction as a regression problem. Bloodglucose levels are discrete, and computing the regression estimates maybe more computationally complex. A prediction method (for example, themost likely BGL or the expected BGL) may be selected based on empiricalevaluation using training and test data for each model that isattempted. Other factors may be considered, such as computationalrequirement. In some embodiments different methods and/or combinationsof methods may be employed.

However the probability model, for example, p(b_(τ)|b_(t), a_(t),d_(t)), is used, there are still a number of ways to implement (i.e.,represent and learn) the model given training data. Some examples arediscussed below.

Neural Network Solution

In the model p(b_(τ)|b_(t), a_(t), d_(t)), there are a fixed number ofvariables employed. For example, b_(t), a_(t), and d_(t) are all vectorsof a fixed length. Also, in the model, a few different models for τ maybe employed. (For example, the model may use τ₁=t+1, up to say 1 hourinto the future τ₄=t+4).

One method that may be employed is to use four static models instead ofa dynamic model. For example, for each τ_(i); i=1 . . . 4, produce aseparate predictor. This approach has the advantage that it isrelatively easy to implement. Also, this approach does not requiredesign of a large collection of features, since the equivalent“features” are learned automatically by the learning process. However,this approach may not be as easily generalized to other queries (i.e.,given these models, computing other forms of probability query, such as,for example, τ₅=t+5, may be more difficult). In addition, these modelsmay be less easily used with variable length input (for example,predictions with something different than the previous 8 hours).

In the example model, a single function g is produced and trained thatmaps from the input b_(t), a_(t), d_(t) directly to a distribution onthe output, of the form

p(b _(τ) |b _(t) ,a _(t) ,d _(t))=g _(w)(b _(τ) |b _(t) ,a _(t) ,d _(t))

where W is a collection (vector) of parameters. A 3-layer multilayerperceptron (MLP) that is trained using stochastic gradient descent mayprovide an easy to use, yet still powerful and general, form of a model.

Two matrices of weight parameters W_(i2h) (the input to hidden weights)and W_(h2o) (the hidden to output weights) are produced. The input maybe represented using the vector

x _(t)=(b _(t) ,a _(t) ,d _(t)),

and the corresponding output as

y _(t) =b _(τ)

for notational simplicity. The form of the function is as follows:

P(y _(t) |x _(t))=g _(h2o)(W _(h2o) g _(i2h)(W _(i2h) x _(t)))

where g_(i2h)( ) is a vector sigmoid function, namely it maps the vectorW_(i2h)x_(t) to a vector of outputs. Each sigmoid function maps a vectorto a scalar and form:

${g_{i\; 2h}(z)} = \frac{1}{1 + e^{\alpha \; z}}$

where α is a vector of parameters, and in the case above, there is a setof K sigmoids, one for each element of the vector W_(i2h)x_(t). Thepower of an MLP approach in fact is this parameter K, the larger the Kthe more powerful the classifier becomes, but also the more trainingdata that is needed.

The 2nd function g_(h2o) is a “softmax” function that maps its inputvector as follows for the i^(th) output:

${g_{h\; 2\; o}^{i}(z)} = \frac{e^{a_{i}z}}{\sum\limits_{i}\; e^{a_{i}z}}$

This form may be trained using simple stochastic gradient descent (forexample, adjusting the parameters of the model incrementally byrepeatedly adding the derivative of a cost function to the weightvector).

The input, x_(t), may be represented in a number of ways. In the examplecase, x_(t) is a mix of variables. If x_(t) consisted of b_(t) anda_(t), then it would have 30³²×500 possible values (32 input variableseach with 30 possible values and an additional input variable with 500values). For example, x_(t) could be encoded by encoding each variable(for example, use 5 bits for each 30-valued variable, and 9 bits for the500-valued variable). Each variable value could be represented by avector of inputs to the MLP corresponding to the pattern of 1s and 0sthat encode its binary number. This produces an MLP that has

32·5+9=169,

which is reasonably small for a neural network. Another way of encodingthe MLP is to use the inputs directly, leading to 32+1=33 inputs. Inthis last case, it may be more advantageous to use more of the inputs.For example, b_(t) and a_(t) as well as all of a_(t) and possibly d_(t)as the input. This approach uses at least 4 separately trained models,one for each value of r.

Dynamic Model Solution

A dynamic model is one that models the entire sequence of variables. Forexample, let's suppose that there are a total of T time steps. This maybe modeled as a joint distribution of the form:

p(b1,b2, . . . ,b _(T) ,a1,a2, . . . ,a _(t) ,d ₁ ,d ₂ , . . . ,d _(T))

A model like an HMM, Dynamic Bayesian Network (DBN), or some form ofdynamic graphical model may be employed. An advantage of a dynamic modelis that, during training, the variables may be observed, which providesan opportunity for training procedures which might otherwise not beavailable.

One example model would use a set of patterns or curves designed tomatch aspects of a blood glucose history. It may include indicator“features” for each such pattern that indicated how well the currentb_(t) matched a given pattern.

Assume a collection of I temporal patterns ϕ_(i)(τ) for τ=0, . . . ,L_(i), where L_(i) is a length of an i^(th) pattern. For example, an8-hour pattern may have a length of 32. Patterns may correspond to anylength of observation of a variable or variables. In the trainingexample discussed below, the values of b_(t), a_(t) and d_(t) will beobserved for time points up to and including time t.

When predicting into the future, b_(t), a_(t), d_(t) will be known forpoints up to and including time t, but values for τ>t will not be known.When computing b_(τ) in the future by more than one time step, thelength of these patterns may significantly impact the computation timeand processing requirements, particularly when several steps into thefuture are computed. Fortunately, computing only a limited number ofsteps into the future may provide useful results. Several examplesolutions for predicting four steps into the future will be outlinedbelow.

A set of features (or patterns) may be selected for use, along with usesfor particular features or patterns in the set. For example, a givenpattern may be compared for how well it matches to a current bloodglucose history at a time t by using a simple dot product, as follows:

${{{{{\Phi_{i}(t)} = {{\sum\limits_{\tau = 0}^{L_{i}}\; {{\varphi_{i}(\tau)}b_{t - \tau}}} = {\varphi_{i}}}}}b_{t}}}\cos \; \theta$

where θ is the angle between the two vectors ϕ_(i) and b_(t). If b_(t)is exactly the same, then the dot product will have a large value, butif the features are pointing in very different (orthogonal) directions,then cos θ will be small, leading to a small dot product.

In one approach, a large number of features or patterns may be in theset, for example, several thousand patterns. This corresponds to a“pre-warped” case, meaning that the patterns/curves are pre-warped to beall of the interesting shapes that might occur.

One alternative approach is to use a smaller number of patterns, forexample 8 patterns, and treat them as pattern “templates” or “mothercurves” which act as an exemplar for all other possibly warped curves.In this alternate approach, dynamic time warping may be employed in thecalculation of the Φ_(i)(t) function. This dynamic time warpingcalculation may require another set of parameters, which may need to belearned. This alternative approach is more complicated.

The above feature functions Φ_(i)(t) so far only relate BGL levels toeach other at different times. That is, the Φ_(i)(t) features arefunctions only of present and past values of BGL. The AI values may beutilized and “interact” with BGL values. There are several ways to dothis, but regardless of how it is done, indicator-like feature functions(similar to the above dot-product features) may be utilized that expresssome important joint property among the variables b_(t) and (at least)a_(t). These features may be designed by a medical professional. Acollection of such feature functions incorporating a_(t) (and possiblyother values such as dosing information) may be designated Ψ_(j)(t). Thevariable j denotes that this is the j^(th) feature, and that it appliesat time t. Further, J such features may be employed. This means that foreach j, Ψ_(j)(t) is some fixed function of a_(t), and possibly of somepast values of AI and BGL as well (and if it is so desired, past andcurrent values of dose).

All the feature functions Φ_(i)(t) for i=1 . . . I and Ψ_(j)(t) for j=1. . . J are deterministic, meaning they are fixed functions of pastvalues of AI, BGL, and possibly dose. There are no learned parametersassociated with these features. The learned parameters may be used todetermine which (combination of) features are most important to predictfuture values of BGL.

For each feature Φ_(i)(t), one parameter λ_(i) may be employed, and foreach feature Ψ_(j)(t), one parameter γ_(j) may be employed. Theseparameters are applicable for all time t. Each such parameter expresseshow important the corresponding feature is at predicting BGL. A jointprobability model (again ignoring dose d_(t) for the moment) may berepresented as:

${p\left( {b_{1},b_{2},K,b_{T},a_{1},a_{2},K,a_{T}} \right)} = {\frac{1}{Z}{\prod\limits_{t = 1}^{T}\; {\exp\left( {{\sum\limits_{i}^{\;}\; {\lambda_{i}{\Phi_{i}(t)}}} + {\sum\limits_{j}^{\;}\; {\gamma_{j}{\Psi (t)}}}} \right)}}}$

Given observed sequences of these values, there are a number of ways totrain the parameters {λ_(i)}_(i=1) ^(I) and {γ_(j)}_(j=1) ^(J). Forexample, stochastic gradient descent (for example, the MLP above), or aperceptron algorithm may be employed. The stochastic gradient descentmethod described in “Adoptive Probabilistic Networks with HiddenVariables”, by John Binder, et al., Machine Learning Journal, Volume 29,Numbers 2-3, November 1997, pages 213-244; the gradient descent methodsand principles described in “A self-tuning method of fuzzy control bydescent method,” by Nomura, H., et al., Proc. of the IFSA′91 (1991), pp.155-158; and “An Improved Self-Tuning Mechanism of Fuzzy Control byGradient Descent Method,” by Habbi, A., et al., Foundations forSuccessful Modeling & Simulation, 17th European SimulationMulticonference (2003), pp. 43-47, may be employed. The perceptronalgorithm may be easier to use, but gradient descent methods may producebetter results.

In one example embodiment, active insulin (AI) and blood glucose (BGL)data, such as histories, may be used as training data. Some embodimentsmay employ different and/or additional data and/or data histories astraining data. In this example, a large collection of training data isavailable and the training data are used to select parameter values fora learning method. A large collection of training data is assumed. Thetraining data may be used to determine the best parameter values for thelearning algorithms. The training data in this example is a set ofsequences of BGL and AI values. That is, D is a set of training datathat may be notated as:

D={(b _(1:T) ₁ ,a _(1:T) ₁ ),(b _(1:T) ₂ ,a _(1:T) ₂ ), . . . ,(b _(1:T)_(M) ,a _(1:T) _(M) )}

which means there will be M separate independent sequences of trainingdata, and that the m^(th) training sequence has time length T_(m) (whichmeans that each sequence may have a different time length).

In order to simplify notation even further, the parameters {λ_(i)}_(i=1)^(I) and {γ_(j)}_(j=1) ^(J) may be bundled into one long I+J-lengthvector called λ. Also, the feature functions, Φ_(i)(t) for i=1 . . . Iand Ψ_(j)(t) for j=1 . . . J, may be bundled into one long I+J-lengthvector-valued function h(t). This means that the dot-product λh(t) iswell-defined (λh(t) is just a scalar value), and that the probabilitymodel may be represented using the following notation:

${p\left( {b_{1},b_{2},\ldots \mspace{14mu},b_{T},a_{1},a_{2},\ldots \mspace{14mu},a_{T}} \right)} = {{\frac{1}{Z}{\prod\limits_{t = 1}^{T}\; e^{\lambda \; {h{(t)}}}}} = {\frac{1}{Z}{\exp \left( {\sum\limits_{t = 1}^{T}\; {\lambda \; {h(t)}}} \right)}}}$  where$\mspace{20mu} {Z = {\sum\limits_{b_{1:T},a_{1:t}}^{\;}\; {\exp \left( {\sum\limits_{t = 1}^{T}\; {\lambda \; {h(t)}}} \right)}}}$

Note that Z does not need to be computed, thus avoiding significantcomputational issues, and that Matlab™-like notation may be employed:b_(1:T)=(b₁, b₂, . . . , b_(T)) and a_(1:T)=(a₁, a₂, . . . , a_(T)). Asdefined above, each feature function h(t) involves BGL and AI valuesonly up to and including time t—this means that h(t) does not involveany variables for times greater than t, as defined.

The learning with the training data D may be used to adjust theparameters A so that the data are best represented by the parameters.The learning may include computing the most probable values of future(over the next hour) BGL levels. Some example methods that may beemployed to compute the most probable values are summarized below, andsubsequent material describes various learning procedures.

Assume that the current time (now) is t₀. The most probable values ofb_(τ) for τ=t₀+1, τ=t₀+2, τ=t₀+3, and τ=t₀+4 (i.e., up to one hour intothe future assuming 15-minute time steps) may be computed. The values ofBGL and AI up to and including time t₀ are known. The followingprobability model may be employed:

${p\left( {b_{1},b_{2},\ldots \mspace{14mu},b_{\tau},a_{1},a_{2},\ldots \mspace{14mu},a_{\tau}} \right)} = {\frac{1}{Z}{\prod\limits_{t = 1}^{\tau}\; e^{\lambda \; {h{(t)}}}}}$

for any desired τ.

For notational simplicity, t₁=t₀+1, t₂=t₀+2, t₃=t₀+3, t₄=t₀+4.Therefore, the estimated value of b_(t) ₁ , which may be denoted as{circumflex over (b)}_(t) ₁ , may be determined according to:

${\hat{b}}_{t_{1}} = {{\underset{b_{t_{1}} \in D_{b}}{\arg \; \max}\mspace{14mu} {p\left( {\left. b_{t_{1}} \middle| b_{t} \right.,a_{t}} \right)}} = {{\underset{b_{t_{1}} \in D_{b}}{\arg \; \max}\mspace{14mu} {p\left( {b_{t_{1}},b_{t},a_{t}} \right)}} = {\underset{b_{t_{1}} \in D_{b}}{\arg \; \max}{\sum\limits_{a_{t_{i}}}^{\;}\; {p\left( {b_{t_{1}},a_{t_{1}},b_{t},a_{t}} \right)}}}}}$

The second equality holds because p(b_(t), a_(t)) is a constant whentaking the maximum over b_(t) ₁ . The third equality holds when the sumis computed over the AI values to obtain a marginal distribution thatdoes not involve a_(t) ₁ . The value of a_(t) ₁ is not known yet becausethe dose at time t₁ is not known.

Alternatively, because AI is related using a formula to the current dosetime t, and if the dose at time t₁ is known, the value of AI at time t₁may be known and the following computation may be employed:

${\hat{b}}_{t_{1}} = {\underset{t_{t_{1}} \in D_{b}}{\arg \; \max}\mspace{14mu} {p\left( {b_{t_{1}},a_{t_{1}},b_{t},a_{t}} \right)}}$

where in this last form, a_(t) ₁ is the computed value of a_(i) computedbased on the current dose.

In this example, BGL is predicted not only for time t₁ but also fortimes t₂ through t₄. One probabilistic way to do this would be tocompute predictions of BGL at all times t₁ through t₄ simultaneously(i.e., jointly).

This may be represented as follows:

$\left( {{\hat{b}}_{t_{1}},{\hat{b}}_{t_{2}},{\hat{b}}_{t_{3}},{\hat{b}}_{t_{4}}} \right) = {\underset{b_{t_{1}} \in D_{b}}{\arg \; \max}\; \underset{b_{t_{2}} \in D_{b}}{\arg \; \max}\; \underset{t_{t_{3}} \in D_{b}}{\arg \; \max}\; \underset{t_{t_{4}} \in D_{b}}{\arg \; \max}\mspace{14mu} {p\left( {b_{t_{1}},b_{t_{2}},b_{t_{3}},\left. b_{t_{4}} \middle| b_{t} \right.,a_{t}} \right)}}$

This computation would require O(r⁴) computational steps, wherer=|D_(b)|. The model

p(b _(t) ₁ ,b _(t) ₂ ,b _(t) ₃ ,b _(t) ₄ |b _(t) ,a _(t))

may be determined according to:

${{p\left( {b_{t_{1}},b_{t_{2}},b_{t_{3}},\left. b_{t_{4}} \middle| b_{t} \right.,a_{t}} \right)}\alpha \mspace{11mu} {p\left( {b_{t_{1}},b_{t_{2}},b_{t_{3}},b_{t_{4}},b_{t},a_{t}} \right)}} = {\sum\limits_{a_{t_{1}}}^{\;}\; {\sum\limits_{a_{t_{2}}}^{\;}\; {\sum\limits_{a_{t_{3}}}^{\;}\; {\sum\limits_{a_{t_{4}}}^{\;}\; {p\left( {b_{t_{1}},a_{t_{1}},b_{t_{2}},a_{t_{2}},b_{t_{3}},a_{t_{3}},b_{t_{4}},a_{t_{4}},b_{t},a_{t}} \right)}}}}}$

Again, since p(b_(t), a_(t)) is a constant when taking the maximum overb_(t) ₁ , something that is proportional to the conditional probability(which is the reason for the proportional sign in the equation above)may be employed. The right-hand-side requires computation of O(s⁴),where s=|D_(a)|.

From the previous discussion, when r=30, r⁴≈800,000 which is somethingthat is quite feasible for a modern computer to do in a few seconds ofcompute time. However, s=500, so s⁴≈62 billion steps. While some modernmicroprocessors could probably do something like this in a few minutes,this may be too computationally complex for some embodiments.

Therefore, as an approximation, a reasonable compromise may be to treatthe predicted BGL for a prior time step as an actual BGL for predictingthe BGL for the next time step, and then utilize the method mentionedabove for all time steps. For example, one of the methods describedabove may be used to predict the BGL for time t₁. Then using thepredicted BGL for time t₁ as an actual BGL, predict the BGL for time t₂.Proceeding in this way, the predicted BGL for times t₁ and t₂ may betreated as actual BGLs for predicting the value for t₃, and thepredicted BGL for times t₁, t₂ and t₃ would be treated as actual BGLsfor predicting the for time t₄. The computation for predicting BGL usingthis approximation would only be 4 times the cost of predicting the nexttime step, significantly reducing processing requirements andfacilitating rapid prediction.

An alternative strategy (that would trade off computation andapproximation) would be to jointly predict BGL for t₁ and t₂, and thenuse the two predicted values when predicting BGL for times t₃ and t₄.Empirical testing may be employed to determine a particular strategy foruse in an embodiment. Multiple strategies may be employed and may varybased on conditions and variables, such as an actual BGL. A look-uptable may be employed.

The predicted BGL for times t₁ through t₄ may be designated

-   -   {circumflex over (b)}_(t1), {circumflex over (b)}_(t2),        {circumflex over (b)}_(t3), and {circumflex over (b)}_(t4)        or more succinctly

The actual values of BGL for the future times may be denoted:

-   -   b_(t) _(1:4) .

Perceptron Learning Example

FIG. 14 illustrates a perceptron learning method 1400 that may beemployed to training a model used by a system, such as the embodimentsdescribed herein. Perceptron learning is a simple method that may workvery well for training a model. The value of a parameter serves as anindication of how important the corresponding feature is to the accuracyof the model's predictions. The method 1400 corrects the model when itmakes mistakes in predicting b_(t) _(1:4) , and leaves the model alonewhen it does not make mistakes.

At 1402, the system receives or retrieves a set of training data. Theset of training data may comprise, for example, a large set of trainingdata. The data set may include, for example, current and historical AIdata, BGL data, and dosing data. The method 1400 proceeds from 1402 to1404.

At 1404, the system receives or retrieves an iteration parameter N. Theiteration parameter N may be used to determine when the model istrained. In the illustrated example, N is used to set the number oftraining passes that are made through the data set. The value of N maybe set empirically by observing when additional passes make little or nodifference to the value of a model parameter vector. In other words,convergence has occurred. Other methods may be employed to determinewhen a model is sufficiently trained. For example, changes to a modelparameter vector during a pass may be compared to a threshold value orpercentage, and the training cycle for the model parameter vectorterminated when the changes are less than the threshold. Someembodiments may terminate training of a model when a threshold value orpercentage is not exceeded for a threshold number of successive passes.The method 1400 proceeds from 1404 to 1406.

At 1406, the system initializes the model parameter vector for the modelto be trained. In this discussion, the model parameter vector to betrained is set to a zero vector. The method 1400 proceeds from 1406 to1408.

At 1408, the system initializes a counter n for counting a number ofpasses through the data. The method 1400 proceeds from 1408 to 1410. At1410, the system initializes a variable m for keeping track of thesample sequence in the data set. The method 1400 proceeds from 1410 to1412. At 1412, the system initializes a variable t for tracking timeperiods. The method 1400 proceeds from 1412 to 1414. At 1414, the systemsets t₀ to t. The method 1400 proceeds from 1414 to 1416.

At 1416, the system computes {circumflex over (b)}_(t) _(1:4) for thecurrent t₀, and sample m. The method 1400 proceeds from 1416 to 1418. At1418, the system determines whether {circumflex over (b)}_(t) _(1:4) forthe current t₀, and sample m is equal to b_(t) _(1:4) . When it isdetermined at 1418 that {circumflex over (b)}_(t) _(1:4) ≠b_(t) _(1:4) ,the method 1400 proceeds from 1418 to 1420. When it is determined at1418 that {circumflex over (b)}_(t) _(1:4) =b_(t) _(1:4) , the methodproceeds from 1418 to 1428.

At 1420, the system sets λ=λ+ƒ(t₁)−{circumflex over (ƒ)}(t₁). The method1400 proceeds from 1420 to 1422. At 1422, the system setsλ=λ+ƒ(t₂)−{circumflex over (ƒ)}(t₂). The method proceeds from 1422 to1424. At 1424, the system sets λ=λ+ƒ(t₃)−{circumflex over (ƒ)}(t₃). Themethod 1400 proceeds from 1424 to 1426. At 1426, the system setsλ=λ+ƒ(t₄)−{circumflex over (ƒ)}(t₄). The method proceeds from 1426 to1428. The vector-valued function ƒ(τ) is the length J+I vector offeature values up to and including time τ that uses the actual values ofBGL and AI. The vector-valued function {circumflex over (ƒ)}(τ) is thelength J+I vector of feature values up to and including time τ that usesthe actual values of AI but uses the predicted values of BGL. When τ=t₁,then there is only one time point at which a predicted value is needed,namely t₁. When τ=t₂, then, like in the case of prediction itself, thepredicted values of BGL at time t₁ are treated as actual values, andused to predict values for t₂. A similar case holds for t₃ and t₄. Ifthe prediction is incorrect, the parameters are moved away from thewrongly predicted values (by subtracting {circumflex over (ƒ)}(τ)) andmoved towards the correct values (by adding ƒ(τ)). In the illustratedexample, this is done four times, once each for t₁ through t₄. If theprediction is correct on the current pattern, however, the model is leftalone.

At 1428, the system determines whether all desired time periods for thecurrent sample sequence have been included in the setting of the modelparameter vector. When it is determined that all desired time periodsfor the sample sequence have been included, the method proceeds from1428 to 1430. When it is determined that not all of the desired timeperiods for the sample sequence have been included, the method 1400proceeds from 1428 to 1432. At 1432, the system increments the value oft. The method 1400 proceeds from 1432 to 1414.

At 1430, the system determines whether all samples in the data set havebeen factored into the setting of the parameter. When it is determinedthat all of the samples in the data set have been included, the methodproceeds from 1430 to 1434. When it is determined that not all of thesamples in the data set have been included, the method 1400 proceedsfrom 1430 to 1436. At 1436, the system increments the value of m. Themethod 1400 proceeds from 1436 to 1412.

At 1434, the system determines whether a convergence criteria has beensatisfied. As illustrated, this is done by comparing a loop counter toan iteration control variable N. Other convergence criteria may beemployed. For example, thresholds may be employed as discussed above.When it is determined that the convergence criteria is satisfied, themethod proceeds from 1434 to 1438. When it is determined that theconvergence criteria is not satisfied, the method 1400 proceeds from1434 to 1440. At 1440, the system increments the value of n. The method1400 proceeds from 1440 to 1410.

At 1438, the system returns the model parameter vector A, and any otherdesired variables. The method 1400 proceeds from 1438 to 1442, wherefurther processing may occur.

Embodiments of the method illustrated in FIG. 14 may contain additionalacts not shown in FIG. 14, may not contain all of the acts shown in FIG.14, may perform acts shown in FIG. 14 in various orders, and may combineacts shown in FIG. 14. For example, the method 1400 may be modified torepeat the method and determine a model parameter vector correspondingto another feature or set of features.

Another example of a method of training a model parameter vector is setforth below in the form of a high-level nested loop, which may beimplemented in source code and/or compiled and stored in acomputer-readable memory medium and used to cause a computing device toperform the method.

-   -   INPUT: Training data D as described above.    -   INPUT: Iteration parameter N    -   INITIALIZATION: Set λ=0 (the vector of all zeros)    -   PROCEDURE:    -   For n=1 . . . N;    -   For m=1 . . . M; do    -   For t=1 . . . T_(m)−4; do    -   Assume t₀=t    -   Compute {circumflex over (b)}_(t) _(1:4) for the current t₀, and        sample m.    -   If {circumflex over (b)}_(t) _(1:4) ≠b_(t) _(1:4) ; then

λ=λ+ƒ(t ₁)−{circumflex over (ƒ)}(t ₁)

λ=λ+ƒ(t ₂)−{circumflex over (ƒ)}(t ₂)

λ=λ+ƒ(t ₃)−{circumflex over (ƒ)}(t ₃)

λ=λ+ƒ(t ₄)−{circumflex over (ƒ)}(t ₄)

-   -   Fi.    -   Done.    -   Done.    -   Done.    -   OUTPUT: The resulting trained parameters λ.

Note that {circumflex over (b)}_(t) _(1:4) computed in the algorithm isbased on whatever the current training sequence it is (indicated in thealgorithm by the value m) even though the letter m is not indicated inthe notation {circumflex over (b)}_(t) _(1:4) , which could have beennotated as {circumflex over (b)}_(t) _(1:4) ^(m,t) ⁰ .

Secondly, the values {circumflex over (b)}_(t) _(1:4) computed in thealgorithm are based on the current time point t₀, and could have beennotated as {circumflex over (b)}_(t) _(1:4) ^(m,t) ⁰ .

The vector-valued function ƒ(τ) is the length J+I vector of featurevalues up to and including time τ that uses the true values of BGL andAI.

The vector-valued function {circumflex over (θ)}(τ) is the length J+Ivector of feature values up to and including time τ that uses the truevalues of AI but uses the predicted values of BGL. When τ=t₁, then thereis only one time point at which the predicted values are needed, namelyt₁. When τ=t₂, then, like in the case of prediction itself, thepredicted values of BGL at time t₁ are assumed to be correct, and thepredicted values for t₂ are used. A similar case holds for t₃ and t₄.

The parameter N is a repetition parameter, which determines how manytimes through the entire training set the algorithm should go. Ingeneral, this parameter may be determined empirically. One way todetermine it is to look at the model parameter vector A after a givenpass through the training data. If it has not moved significantly, itmay be assumed that the algorithm has converged and that it is not worthcomputing any longer.

FIG. 15 illustrates an example data set in accordance with an embodimentof the invention. In the illustrated example, because of theunsynchronized nature of A (Active insulin) and B (Blood sugar) featurepatterns, at any given time the A and B feature segments will seldomstart and stop at the same sample time point.

Suppose at T_(curr) the last completed B feature pattern ended atT_(curr)−15 minutes, i.e., T_(curr) is not a simultaneous Peak or Valleypoint for both the A and B signals.

Then, the example inputs to the Blood Glucose Prediction method atT_(curr) would be:

-   -   1) the actual sequence of B patterns up to T_(curr)−10 minutes,        and    -   2) the actual sequence of A patterns up to T_(curr)−15 minutes,        and    -   3) the probability distributions of B patterns for the period        between T_(curr)−10 and T_(curr), and    -   4) the probability distributions of A patterns for the period        between T_(curr)−15 and T_(curr).

FIG. 16 illustrates a mid-level flow diagram of an embodiment of amethod 1600 of predicting blood glucose levels that may be employed by asystem, such as the dispenser control systems 100, 200 and 300illustrated in FIGS. 1 through 3. For convenience, the method will bedescribed with respect to the embodiment of a dispenser control system100 illustrated in FIG. 1. In this example the predicted blood glucosevalues are restricted to multiples of 30. At 1602 actual training datasequences are received or retrieved by the system 100. Those data mayinclude blood glucose level, active insulin level, insulin dosing dataand other data sequences. The method proceeds from 1602 to 1604.

At 1604, blood glucose and active insulin feature lists, which may bepredefined, are received, retrieved or built by the system 100. Featurelists may be, for example, in xml format. The method 1600 proceeds from1604 to 1606. At 1606, the system 100 updates feature weights based onthe training data. In this example, a perceptron method is employed. Atthis point the model is initialized and is ready to accept new data fromwhich blood glucose predictions may be made. The method proceeds from1606 to 1608.

At 1608, the system 100 senses or receives new blood glucose data. Themethod 1600 proceeds from 1608 to 1610. At 1610, the system 100 updatesthe model parameters based on the new blood glucose data. For example,the blood glucose level that was predicted based on the previous bloodglucose level measurement is compared with the actual measured bloodglucose measurement, at the current time. If the prediction issufficiently close to the measured value, the model parameters remainunchanged; if not, the parameters are iteratively updated until themodel parameters converge. The method 1600 proceeds from 1610 to 1612.At 1612, the system 100 predicts the next blood glucose level, based onthe updated model parameters, the current measured blood glucose value,a calculated active insulin value, and possibly other data. The method1600 proceeds from 1612 to 1614. At 1614, the system 100 determineswhether more predictions are desired. For example, the system maydetermine whether more data has been received in a timely manner. Whenthe system determines that more predictions are desired, the method 1600proceeds from 1614 to 1608. When the system 100 determines that morepredictions are not desired, the method 1600 proceeds from 1614 to 1618,where further or other processing may be performed by the system 100.

Embodiments of the method illustrated in FIG. 16 may contain additionalacts not shown in FIG. 16, may not contain all of the acts illustratedin FIG. 16, may combine or separate acts illustrated in FIG. 16, and mayperform the acts illustrated in FIG. 16 in various orders. For example,the method 1600 may be modified to update the model parameters until newdata is received or expected, and then proceed from 1608 to 1610. Thethreshold levels and ranges discussed with respect to FIG. 16 may befixed or may be functions and may be based on statistical analysis.

FIG. 17 illustrates an embodiment of a method 1700 of adjusting systemcontrol parameters (for example, by adjusting a model parameter vector)based on measured blood sugar levels which may be implemented in real ornear-real time by adjusting the parameters as actual data is received.The method 1700 may be employed, for example, by the systems and methodsfor controlling the dispensing of insulin, such as the embodiments suchdescribed herein. For example, the method 1700 may be employed as asubroutine by an insulin dispensing control system.

At 1702, the system receives, reads or retrieves a blood sugar level.This may be done, for example, at a predetermined rate, such as at15-minute intervals. The method may employ arbitrary fixed and non-fixedblood sugar sample times and may predict arbitrarily far into thefuture. The sampling rate may be fixed or may not be fixed, and mayvary, for example, based on user input, blood sugar levels, patienthistory information, the time of day or other data or variables. Theblood sugar level may be sensed using a blood glucose sensor, which maysense blood glucose levels directly or indirectly. The blood sugarlevels may be stored in a database as part of a history of blood sugarlevels, such as a blood sugar history for a particular patient or adatabase used to train models, including, for example, model parametervectors, employed by the system. The method 1700 proceeds from 1702 to1704.

At 1704, the system compares a blood glucose trajectory to a referenceblood glucose trajectory. The comparison may include, for example,comparing a blood glucose level, a rate of change of the blood glucoselevel, an acceleration of the blood glucose level, and/or otherattributes pertinent to a patient's blood sugar and insulin states. Theblood glucose trajectory may be based on a history for the patient, andmay comprise measured and/or predicted blood glucose levels as describedherein. The reference blood glucose trajectory may be, for example, atrajectory based on parameters set by a professional, such as aphysician, a trajectory based on statistical analysis or models and/or atrajectory based on a combination of set parameters and statisticalanalysis. FIG. 18 illustrates an idealized trajectory that may beemployed. The method 1700 proceeds from 1704 to 1706.

At 1706, the individual control parameters producing the dose for theprevious blood sugar sample are adjusted based on the comparison at1704. Table 4 shows a possible scenario in which the adjustment factorderived at 1604 has a value of 0.2. In this scenario, the (‘BV’, ‘RZ’,‘AZ’) control parameter, as highlighted, has an initial value of 8.0,resulting from the insulin dose given in response to the previous bloodsugar value. In this scenario, the (‘BV’, ‘RZ’, ‘AZ’) control parameterwas subsequently adjusted to 9.5, as shown in the second matrix. Controlparameter adjustment may go beyond adjusting only the individualparameters that produced the previous dose to include adjustment of theoverall fuzzy logic rules matrix shown in FIG. 19. The strategy thatdefines the overall adjustment of the fuzzy logic rules matrix may becalled the dosing matrix coherency policy. An example of that policy isshown in Table 5. The dosing matrix coherency policy may be designed toprevent the occurrences of dosing inconsistencies in the dosing rulesmatrix. For example, for the same blood sugar value, such as BV, andacceleration, such as AZ, the dose for a higher blood sugar rate, suchas RP, should be higher than RZ. In other words, the dose for rule (BV,RP, AZ) should be no smaller than (BV, RZ, AZ), as reflected in thedosing matrix coherency policy and the fuzzy logic rules matrices. See,for example, the fuzzy logic control parameters illustrated in FIG. 19and the embodiments described herein. See discussion of additionaldetails below. The method 1700 proceeds from 1706 to 1708.

TABLE 4 FUZZY LOGIC DOSING RULES MATRIX ADJUSTMENTS rate = VN rate = RNrate = RZ rate = RP rate = RV accl AN AZ AP accl AN AZ AP accl AN AZ APaccl AN AZ AP accl AN AZ AP Before Adjustment of Rule (‘BV’, ‘RZ’, ‘AZ’)BV 5.0 6.0 7.0 BV 6.0 7.0 8.0 BV 7.0 8.0 9.0 BV 7.0 9.0 11.0 BV 8.0 10.012.0 BH 1.5 2.0 4.0 BH 3.0 4.0 6.0 BH 3.0 5.0 7.0 BH 5.0 7.0 9.0 BH 6.09.0 10.0 BN 0.3 0.5 0.7 BN 0.8 1.5 2.5 BN 1.5 2.0 3.0 BN 2.0 4.0 6.0 BN3.0 5.0 7.0 BM 0.0 0.1 0.1 BM 0.1 0.3 0.4 BM 0.3 0.5 0.8 BM 0.5 0.8 1.0BM 1.0 2.0 3.0 BL 0.0 0.0 0.0 BL 0.0 0.0 0.0 BL 0.0 0.0 0.0 BL 0.0 0.10.2 BL 0.1 0.2 0.3 After Adjustment of Rule (‘BV’, ‘RZ’, ‘AZ’), andsubsequent application of Dosing Matrix Coherency Policy to Rules (‘BV’,‘RZ’, ‘AP’), (‘BH’, ‘RZ’, ‘AP’), (‘BV’, ‘RP’, ‘AZ’), and (‘BH’, ‘RP’,‘AP’) BV 5.0 6.0 7.0 BV 6.0 7.0 8.0 BV 7.0 9.5 9.5 BV 7.0 9.5 11.0 BV8.0 10.0 12.0 BH 1.5 2.0 4.0 BH 3.0 4.0 6.0 BH 3.0 5.0 9.5 BH 5.0 7.09.5 BH 6.0 9.0 10.0 BN 0.3 0.5 0.7 BN 0.8 1.5 2.5 BN 1.5 2.0 3.0 BN 2.04.0 6.0 BN 3.0 5.0 7.0 BM 0.0 0.1 0.1 BM 0.1 0.3 0.4 BM 0.3 0.5 0.8 BM0.5 0.8 1.0 BM 1.0 2.0 3.0 BL 0.0 0.0 0.0 BL 0.0 0.0 0.0 BL 0.0 0.0 0.0BL 0.0 0.1 0.2 BL 0.1 0.2 0.3

TABLE 5 DOSING MATRIX COHERENCY POLICY rate = VN rate = RN rate = RZrate = RP rate = RV accl AN AZ AP accl AN AZ AP accl AN AZ AP accl AN AZAP accl AN AZ AP BV 4 5 6 BV 4 5 6 BV 4 5 6 BV 4 5 6 BV 4 5 6 BH 3 4 5BH 3 4 5 BH 3 4 5 BH 3 4 5 BH 3 4 5 BN 2 3 4 BN 2 3 4 BN 2 3 4 BN 2 3 4BN 2 3 4 BM 1 2 3 BM 1 2 3 BM 1 2 3 BM 1 2 3 BM 1 2 3 BL 0 1 2 BL 0 1 2BL 0 1 2 BL 0 1 2 BL 0 1 2

At 1708, the system predicts a next blood glucose level, or a set ofnext blood glucose levels with companion probabilities. This may bedone, for example, using statistical modeling and/or trajectories. See,for example, the embodiments described and/or illustrated herein. Bloodglucose levels may be predicted for more than one future time step. Themethod 1700 advances from 1708 to 1710. As in 1706, the individualcontrol parameters predicted to produce the dose for the next bloodsugar sample are adjusted, based on the comparison at 1704, possiblymodulated by a scale factor that is a function of the probability of thepredicted blood sugar, and then followed by the application of thedosing matrix coherency policy.

The dose for the current blood sugar value may then be determined usingthe updated fuzzy logic control parameters. The method 1700 proceedsfrom 1710 to 1712.

At 1712, the system determines whether the proposed dose satisfies oneor more dose criteria. The dose criteria may comprise, for example,whether the proposed dose is within defined dose ranges, which may ormay not vary based on patient specific information, such as currentand/or historic blood glucose levels, patient weight, etc.; whether theprobability that the proposed dose will result in a desired bloodglucose level, such as a predicted blood glucose level, exceeds athreshold value, which may vary based on the proposed dose and/orpatient specific information; whether or not the predicted next bloodglucose level (or more than one predicted future blood glucose level) iswithin a threshold range, which may or may not vary based on patientspecific information; and/or other variables, such as the time of day.Discrete circuitry, look-up tables, software subroutines, and/orcombinations may be employed, for example, to determine whether theproposed dose satisfies the dose criteria. See, for example, theembodiments described or illustrated herein.

When the system determines at 1712 that the proposed dose does notsatisfy the dosing criteria, the method 1700 proceeds from 1712 to 1706,where the proposed dose is adjusted and a new proposed dose isgenerated. The system may generate feedback that may be used to generatethe new proposed dose at 1706. For example, if the proposed dose wasoutside a dose range, this information may be employed at 1706 when thenew proposed dose is generated. In another example, if the predictedblood glucose level was outside an acceptable range, this informationmay be employed at 1706 when the new proposed dose is generated.

When the system determines at 1712 that the proposed dose satisfies thedosing criteria, the method proceeds from 1712 to 1714. At 1714, thesystem optionally adjusts control parameters to compensate for insulinsensitivity in real time. For example, the system may adjust controlparameters to compensate for deviations between the reference trajectoryand the patient's historical and/or projected blood glucosetrajectories.

In one example embodiment, the BGL may be represented as a function y ofthe insulin dose: y_(t)=f(insulin dose), and descent gradient methodsmay be employed to adjust the control parameters (including modelparameters), such as the methods discussed, described and illustratedherein and/or those described in the identified references.

In another example, the doses in a matrix of fuzzy logic rules, such asthe matrix illustrated in FIG. 19, may be adjusted based on a comparisonof the blood glucose and active insulin levels with a referencetrajectory, such as the idealized reference trajectory illustrated inFIG. 18. In some embodiments, the entire rules matrix may be adjusted tomaintain integrity using linear or non-linear functions relating thedoses of the rules matrix to one another. In another example, descentgradient methods may be employed in combination with adjustment of afuzzy-logic rules matrix, to adjust control parameters, including modelparameters.

The method 1700 proceeds from 1714 to 1716. At 1716, the systemgenerates control signals to cause the commanded dose to be dispensed.The method 1700 proceeds with other processing, and may return to 1702.

Embodiments of the method 1700 illustrated in FIG. 17 may containadditional acts not shown in FIG. 17, may not contain all of the actsshown in FIG. 17, may perform acts shown in FIG. 17 in various orders,and may combine acts shown in FIG. 17.

FIG. 18 illustrates a reference trajectory 1802 and several measuredand/or predicted trajectories 1804, 1806, 1808, 1810, 1812, 1814, 1816.The reference trajectory 1802 may comprise, for example, a theoreticalidealized trajectory prepared by a physician. Time is represented alonga horizontal axis 1818 and a blood sugar level is represented along avertical axis 1820. Corresponding example proposed adjustments toinsulin doses are indicated in a column 1822. For example, thetrajectory 1810 is above the reference trajectory, indicating the bloodsugar level is higher than the projected level. In this example, theproposed adjustment to the insulin dosage is an increase of 5%. Inexemplary trajectories 1808, 1806, and 1804, progressively higher bloodsugar levels result in progressively higher proposed adjustments toinsulin dosage. On the other hand, trajectories 1812, 1814, and 1816exemplify progressively lower blood sugar levels, resulting inprogressively lower adjustments to insulin dosage. Some embodiments mayimpose safety and or other criteria onto the proposed adjustments. Forexample, a proposed adjustment may result in a dose that is betweenspecified dosing levels in a set of dosing levels. The adjustment may bemodified so that the dose is one of the specified dosing levels. Inanother example, a proposed increase may cause a proposed dose to exceeda maximum dose level. The proposed dose may be modified to remain belowthe maximum dose level. Some embodiments may adjust the referencetrajectory based on differences between projected trajectories andmeasured trajectories.

FIG. 19 illustrates an example fuzzy logic Dosing Rules Matrix that maybe applied by an insulin dispenser control system to control thedispensing of insulin. The cells represent insulin doses as a baselinedose, X, and a multiplier. The baseline dose may, for example, be abaseline dose selected by a provider, and may be patient specific. Thefirst fuzzy input is the current blood glucose level BGL in mg/dl units,represented in the bottom four rows with fuzzy coverings VH (very high),HI (high), MD (medium), and NR (normal). The second fuzzy input is therate of change of the blood glucose level, represented in row BGL RATEwith fuzzy coverings VN (very negative), N (negative), Z (zero), P(positive) and VP (very positive). The third fuzzy variable isacceleration of the blood glucose level, represented in row BGLAcceleration with fuzzy coverings N (negative), Z (zero) and P(positive). Example trajectories corresponding to the blood glucoselevel rate of change and acceleration are illustrated in row BGLTrajectory for the previous two sample periods. The fuzzy coverings maybe experimentally determined, and may vary based on additional factorssuch as the method of delivering a dose of insulin. The multipliers inthe cells may be related to each other by linear or non-linearfunctions. In the illustrated example, the multipliers generallyincrease when moving from the bottom to the top, and when moving fromleft to right within a BGL rate group. The matrix may be adjusted by,for example, adjusting the multipliers or the base dosage, orcombinations thereof. A look-up table may be employed in someembodiments.

FIG. 20 illustrates a mid-level flow diagram of an embodiment of amethod 2000 of controlling dispensing of insulin that may be employed bya system, such as the dispenser control systems 100, 200 and 300illustrated in FIGS. 1 through 3. For convenience, the method will bedescribed with respect to the embodiment of a dispenser control system100 illustrated in FIG. 1.

At 2002, the system 100 receives blood glucose data from a blood glucosesensor (see sensor 108 in FIG. 1). The method 2000 proceeds from 2002 to2004. At 2004, the system 100 reads the blood glucose data, retrieveshistorical data and optionally updates a statistical model 2005. Themethod 2000 proceeds from 2004 to 2006. At 2006, the system 100 comparesa trajectory for the current blood glucose reading to an idealizedtrajectory. The method 2000 proceeds from 2006 to 2008. At 2008, thesystem 100 proposes an insulin dose and optionally updates thestatistical model 2005. As illustrated, the system 100 employs afuzzy-logic rules matrix 2010 to propose the dose. The method 2000proceeds from 2008 to 2012.

At 2012, the system 100 predicts a blood glucose value for a next sampleperiod (for example, 15 minutes from the current sample). The method2000 proceeds from 2012 to 2014. At 2014, the system 100 determineswhether the dose satisfies a dosing criteria, this may be done, forexample, as discussed with regard to other example embodiments herein.When the system 100 determines that the dosing criteria is satisfied,the method 2000 proceeds from 2014 to 2016. When the system 100determines that the dosing criteria is not satisfied, the method 2000proceeds from 2014 to 2008, where a new proposed dose is generated. Asdescribed above, the system 100 may factor in reasons why the dosingcriteria was not satisfied when generating a new proposed dose.

At 2016, the system 100 adjusts the fuzzy logic control parameters inthe fuzzy logic rules matrix 2010. This may be done, for example, asdescribed with respect to other embodiments and examples herein. Whenthe system 100 determines that the dosing criteria is satisfied, themethod 2000 proceeds from 2016 to 2018. At 2018, the system 100 commandsan insulin dose to be dispensed by an insulin pump 2020.

Embodiments of the method illustrated in FIG. 20 may contain additionalacts not shown in FIG. 20, may not contain all of the acts illustratedin FIG. 20, may combine or separate acts illustrated in FIG. 20, and mayperform the acts illustrated in FIG. 20 in various orders. Thresholdlevels and ranges employed by the method 2000 illustrated in FIG. 20 maybe fixed or may be functions and may be based on statistical analysis.

The term “computer-readable medium” as used herein refers to any mediumthat participates in providing instructions to a system or a processorfor execution. Such a medium may take many forms, including but notlimited to, non-volatile media, and volatile media. Non-volatile mediaincludes, for example, hard, optical or magnetic disks. Volatile mediaincludes dynamic memory. Common forms of computer-readable mediainclude, for example, a floppy disk, a flexible disk, hard disk,magnetic tape, or any other magnetic medium, a CD-ROM, any other opticalmedium, punch cards, paper tape, any other physical medium with patternsof holes, a RAM, a PROM, EPROM and an EEPROM, a FLASH-EEPROM, any othermemory chip or cartridge, or any other medium from which a computer canread.

Various forms of computer readable media may be involved in carrying oneor more sequences of one or more instructions to a processor forexecution. For example, the instructions may initially be carried on amagnetic disk of a remote computer. The remote computer can load theinstructions into its dynamic memory and send the instructions over atelephone line using a modem. A modem local to computer system canreceive the data on the telephone line and use an infrared transmitterto convert the data to an infrared signal. An infrared detector coupledto a system bus can receive the data carried in the infrared signal andplace the data on system bus. The system bus carries the data to systemmemory, from which a processor retrieves and executes the instructions.The instructions received by system memory may optionally be stored onstorage device either before or after execution by the processor.

Example 1 Insulin Dose Control (IDC) Method

An example of implementing an insulin dose control (IDC) method asdescribed herein was performed as follows.

A bolus insulin dose was calculated based on measured values of bloodglucose level (BGL) at the current time and at a previous time in therecent past. The BGL data were converted into three values for input toan IDC controller: B, the current BGL; R, the rate of change of the BGLwith respect to time; and A, the acceleration of the BGL value withrespect to time (i.e., the rate of change of R or the second derivativeof BGL with respect to time). In the current example, the followingspecific definitions for B, R and A were used:

-   -   B_(i)=the BGL value at the current time T_(i)    -   B_(i-1)=the BGL value at the previous time T_(i-1)

R _(i)=(B _(i) −B _(i-1))/(T _(i) −T _(i-1))

A _(i)=2(R _(i) −R _(i-1))/(T _(i) −T _(i-2))(This can take into accountvariable time steps)

Use of more complex definitions is possible, for example, when there aremore than two time points.

Results of measurement of BGL values beginning one hour before a mealand extending for eight hours after the meal are shown in FIG. 21. TheBGL begins to increase sharply within 30 minutes of initiation of themeal, thus showing a large positive acceleration of the BGL. At about 60minutes after initiation of the meal, the BGL level flattens,corresponding to a large negative acceleration. Moderate accelerationcan be seen at other points on the curve. For a normal adult, 12-hourfasting blood values for glucose typically range between 60 and 100mg/dL. The importance of B and R in determining insulin dose fortreatment of diabetics has been discussed among those responsible forcare of this population. The acceleration A may also be useful as anindicator of the eating behavior of a diabetic.

The insulin dose control method described herein and implemented in thisexample calculates insulin dose, D, as a function of the three variablesidentified above, i.e., D=f(B, R, A). Further as described herein, afuzzy control system is used to perform the dose calculation. Fuzzylogic and fuzzy control systems have been described as computing withwords. Such methods have been found herein to be well suited forimplementing protocols used by and incorporating dosing expertise ofmedical professionals involved in the treatment, for example, of type 1diabetics. These methods have thus been used herein in developing themethod for making decisions for administering insulin doses in treatingdiabetics.

Fuzzy coverings are illustrated in FIGS. 22A and 22B. The four variable(inputs B, R, A, and output D) were fuzzified by defining a fuzzy setfor each. Each member of an illustrated fuzzy set is a symmetrictrapezoid with values of the members A, D, and W. A is the location ofthe center of the trapezoid. D is the half-width of the top. W is thehalf-width of the bottom. Thus, the (X,Y) coordinates of the fourcorners of the trapezoid are (A−W,0.0), (A−D,1.0), (A+D,1.0) and(A+W,0.0). If D is zero, the shape becomes an isosceles triangle, as inthe output fuzzy set for dose shown in FIG. 22B. For the three inputfuzzy sets, B, R, and A, the lowest member (BN, RN, AN) was extended to−infinity, while the highest member (BV, RV, AP) was extended to+infinity, as shown in FIG. 22A. No such extensions were done formembers of the output fuzzy set.

An example is described here. The sensor sent a new BGL measurement of193 mg/dL. The two previous BGL measurements were taken from the BGLhistorical data. These BGL measurements were 173 mg/dL (15 minutesearlier) and 161 mg/dL (30 minutes earlier). The rate R was calculatedto be 1.333 mg/dL/min, and the acceleration A was calculated to be 0.035mg/dL/min².

Fuzzification is the process of converting a crisp value (i.e., 193mg/dL) into a set of truth values for the appropriated fuzzy members(i.e., 0.00, 0.35, 0.65, and 0.00 for BN, BM, BH, and BV, respectively.)Values for B, R, and A were fuzzified as follows:

-   -   B=193.0 was fuzzified to [(‘BM’, 0.350, (‘BH’, 0.65)]    -   R=1.333 was fuzzified to [(‘RP’, 1.00)]    -   A=0.035 was fuzzified to [(‘AZ’, 1.00)]

After each of the crisp inputs was fuzzified, the rules, as shown inTable 6, were applied, using ‘if-then’ clauses. For example,

If B is BM and R is RP and A is AZ, then D is D40.

TABLE 6 IDC RULES BGL Rate: RN RZ RP RV BGL Acceleration: AN AZ AP AN AZAP AN AZ AP AN AZ AP BGL Trajectory:

BGL BV D01 D10 D70 D01 D20 D80 D01 D80 D80 D01 D90 D90 BH D01 D10 D20D01 D20 D50 D01 D80 D80 D01 D90 D90 BM D01 D05 D10 D01 D10 D20 D01 D40D40 D01 D80 D90 BN D01 D05 D01 D01 D02 D05 D01 D05 D10 D01 D05 D10

In this example, only two rules were fired:

-   -   If B is BM and R is RP and A is AZ, then D is D40 with firing        strength 0.35; and    -   If B is BH and R is RP and A is AZ, then D is D80 with firing        strength 0.65.

All other rules had zero firing strength.

The fuzzy output for dose was D40 with truth value 0.35 and D80 withtruth value 0.65.

The fuzzy output was converted from a fuzzy result to a crisp result bythe process of defuzzification. The defuzzified dose value is thecentroid (sometimes called the center of mass or center of area) of theresulting fuzzy dose. In this example, D40 and D80 were clipped by theirtruth values, yielding the result illustrated in FIG. 23. The centroidin this case was 2.48. Thus, the crisp dose was determined to be 2.48.

Example Calculation of Dose Using Fuzzy Logic.

-   -   Min—max method for and & or operations.        -   Defuzification to get crisp value of dose. Calculation using            centroid.    -   Sum—product method for and & or operations.        -   Weighted sum calculation to get crisp value of dose.

Example 2 Determination of Viterbi Probability of a Sequence of ObservedStates

Below is an example of the Viterbi probability of the sequence ofobserved states ‘NOR’, ‘MED’, ‘HIGH’, ‘VHIGH’ given the below statetransition probabilities and emission probabilities.

  states = (‘N’, ‘M’, ‘H’, ‘VH’) observations = (‘NOR’, ‘MED’, ‘HIGH’,‘VHIGH’) start_probability = {‘N’: 1.0, ‘M’: 0.0,‘H’: 0.0, ‘VH’: 0.0}transition_probability = {  ‘N’ : {‘N’: 0.1, ‘M’: 0.9,‘H’: 0.0, ‘VH’:0.0},  ‘M’ : {‘N’: 0.0, ‘M’: 0.2,‘H’: 0.8, ‘VH’: 0.0},  ‘H’ : {‘N’: 0.0,‘M’: 0.0,‘H’: 0.2, ‘VH’: 0.8},  ‘VH’ : {‘N’: 0.0, ‘M’: 0.0,‘H’: 0.1,‘VH’: 0.9},  } emission_probability = {  ‘N’ : {‘NOR’: 1.0, ‘MED’: 0.0,‘HIGH’: 0.0, ‘VHIGH’: 0.0},  ‘M’ : {‘NOR’: 0.0, ‘MED’: 1.0, ‘HIGH’: 0.0,‘VHIGH’: 0.0},  ‘H’ : {‘NOR’: 0.0, ‘MED’: 0.0, ‘HIGH’: 1.0, ‘VHIGH’:0.0},  ‘VH’ : {‘NOR’: 0.0, ‘MED’: 0.0, ‘HIGH’: 0.0, ‘VHIGH’: 1.0},  }def forward_viterbi(y, X, sp, tp, ep):  T = { }  for state in X:   ##prob. V. path V. prob.   T[state] = (sp[state], [state], sp[state])  foroutput in y:   U = { }   for next_state in X:    total = 0    argmax =None    valmax = 0    for state in X:     (prob, v_path, v_prob) =T[state]     p = ep[state][output] * tp[state][next_state]     prob *= p    v_prob *= p     total += prob     if v_prob > valmax:      argmax =v_path + [next_state]      valmax = v_prob     U[next_state] = (total,argmax, valmax)    T = U   ## apply sum/max to the final states:   total= 0   argmax = None   valmax = 0   for state in X:    (prob, v_path,v_prob) = T[state]    total += prob    if v_prob > valmax:     argmax =v_path     valmax = v_prob   return (total, argmax, valmax) defexample2( ):  return forward_viterbi([‘NOR’, ‘MED’, ‘HIGH’, ‘VHIGH’],      states,       start_probability,       transition_probability,      emission_probability) >>> example2( ) (0.57600000000000007, [‘N’,‘M’, ‘H’, ‘VH’, ‘VH’], 0.51840000000000008)Thus, the probability of the sequence of observed states was determinedto be 0.576.

Example 3 Prediction of Blood Glucose Values

A blood glucose feature list, with learned weights, in xml format wasderived from the blood glucose prediction method illustrated in FIG. 16.The features were built in step 1604 and assigned default weights. Theweights were updated in step 1606 using a training set of real patientblood sugar data. The training set of blood sugar values was read intothe program at step 1602. The actual values and corresponding predictednext values are shown below in Table 7. This sequence of values wasbuilt iteratively by execution of steps 1608, 1610 and 1612 insuccession as each new blood glucose value was entered.

TABLE 7 BLOOD GLUCOSE VALUES Actual Predicted Value Next Value 134.0150.0 139.0 120.0 151.0 120.0 169.0 150.0 191.0 150.0 214.0 150.0 239.0180.0 253.0 180.0 268.0 210.0 276.0 210.0 275.0 240.0 260.0 240.0 246.0240.0 254.0 240.0 256.0 240.0 249.0 240.0 240.0 240.0 220.0 240.0 230.0240.0 214.0 240.0 201.0 240.0 191.0 210.0 188.0 210.0 188.0 210.0

All of the U.S. patents, U.S. patent application publications, U.S.patent applications, foreign patents, foreign patent applications andnon-patent publications referred to in this specification and/or listedin the Application Data Sheet are incorporated herein by reference, intheir entirety.

Although specific embodiments of and examples for the blood glucoseprediction system, dispenser control systems, blood glucose sensors, andinsulin dispensers, the devices, methods, and articles are describedherein for illustrative purposes, various equivalent modifications canbe made without departing from the spirit and scope of this disclosure,as will be recognized by those skilled in the relevant art. The variousembodiments described above can be combined to provide furtherembodiments.

These and other changes can be made to the invention in light of theabove-detailed description. In general, in the following claims, theterms used should not be construed to limit the invention to thespecific embodiments disclosed in the specification and the claims.Accordingly, the invention is not limited by the disclosure, but insteadits scope is to be determined entirely by the following claims.

1.-10. (canceled)
 11. An integrated circuit, comprising: one or moreinputs; and processing circuitry, which, in operation, adjustsfuzzy-logic control parameters based on received and retrieved bloodglucose-related data; predicts blood glucose levels based on thereceived blood-glucose-related data; and generates control signals tocontrol dispensing of insulin based on the received bloodglucose-related data and the fuzzy-logic control parameters.
 12. Theintegrated circuit of claim 11 wherein the processing circuitry, inoperation, predicts blood glucose levels based on the retrieved bloodglucose-related data.
 13. The integrated circuit of claim 11 wherein theprocessing circuitry, in operation, selectively transitions between apost-meal correction protocol and a fasting protocol.
 14. The integratedcircuit of claim 11 wherein the processing circuitry, in operationtransitions from a post-meal correction protocol to a fasting protocolwhen a fasting criteria is satisfied.
 15. The integrated circuit ofclaim 11 wherein the processing circuitry, in operation, transitionsfrom a fasting protocol to a post-meal correction protocol when aprandial event is detected.
 16. The integrated circuit of claim 11wherein the processing circuitry, in operation, transitions from afasting protocol to a user-input protocol when a prandial event isdetected.
 17. The integrated circuit of claim 11 wherein the fuzzy-logiccontrol parameters comprise fuzzy-logic multipliers.
 18. The integratedcircuit of claim 11 wherein the predicting blood glucose levelscomprises predicting a subsequent blood glucose level based on apreviously predicted blood glucose level.
 19. The integrated circuit ofclaim 11 wherein the processing circuitry, in operation, implements atleast one of a neural network and a dynamic Bayesian network.
 20. Theintegrated circuit of claim 11 wherein the processing circuitrycomprises a memory storing instructions, and the integrated circuit, inoperation, executes the instructions.